OpenBSD CVS

CVS log for src/usr.bin/compress/gzopen.c


[BACK] Up to [local] / src / usr.bin / compress

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: OPENBSD_7_4


Revision 1.35 / (download) - annotate - [select for diffs], Sat Jun 18 03:23:19 2022 UTC (23 months, 3 weeks ago) by gkoehler
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.34: +21 -18 lines
Diff to previous 1.34 (colored)

Fix gzip byte counts with 32-bit integers

If zlib is without our local change in lib/libz/zlib.h r1.7, then
s->z_stream.total_in and s->z_stream.total_out might overflow on
architectures where uLong has 32 bits.  After overflow, the total
would be 4G below the correct total.

Calculate our own 64-bit totals.  When decompressing, take
(uLong)s->z_stream.total_in as a total modulo ULONG_MAX + 1.

ok tb@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.