From: tb Date: Thu, 11 Aug 2022 02:56:34 +0000 (+0000) Subject: Revert uLong -> z_off_t change in the kernel X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a004629d760f7ffd835d5061168fece5627886e4;p=openbsd Revert uLong -> z_off_t change in the kernel The kernel source assumes the original zlib ABI. There is no reason to stick to this local change. Pull in a fix matching ctfdump.c -r1.26. This is hopefully the last change necessary to undo a painful hack that was committed 19 years ago without ok. Someone owes me a lot of beer... ok millert --- diff --git a/sys/ddb/db_ctf.c b/sys/ddb/db_ctf.c index ddb7ae8f777..bfb0c6d24e1 100644 --- a/sys/ddb/db_ctf.c +++ b/sys/ddb/db_ctf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_ctf.c,v 1.31 2021/10/27 21:21:35 jasper Exp $ */ +/* $OpenBSD: db_ctf.c,v 1.32 2022/08/11 02:56:35 tb Exp $ */ /* * Copyright (c) 2016-2017 Martin Pieuchot @@ -547,8 +547,8 @@ db_ctf_decompress(const char *buf, size_t size, off_t len) goto exit; } - if (stream.total_out != len) { - db_printf("decompression failed: %llu != %llu", + if (len < 0 || (uintmax_t)stream.total_out != (uintmax_t)len) { + db_printf("decompression failed: %lu != %lld", stream.total_out, len); goto exit; } diff --git a/sys/lib/libz/zlib.h b/sys/lib/libz/zlib.h index 2a49db489ef..abf43aad07d 100644 --- a/sys/lib/libz/zlib.h +++ b/sys/lib/libz/zlib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: zlib.h,v 1.15 2022/05/08 14:05:29 tb Exp $ */ +/* $OpenBSD: zlib.h,v 1.16 2022/08/11 02:56:34 tb Exp $ */ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.12, March 11th, 2022 @@ -88,11 +88,11 @@ struct internal_state; typedef struct z_stream_s { z_const Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ - z_off_t total_in; /* total number of input bytes read so far */ + uLong total_in; /* total number of input bytes read so far */ Bytef *next_out; /* next output byte will go here */ uInt avail_out; /* remaining free space at next_out */ - z_off_t total_out; /* total number of bytes output so far */ + uLong total_out; /* total number of bytes output so far */ z_const char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */