opnsense-src/usr.bin/compress
David Jones 03b4f23235 uncompress: Avoid reading an extra byte
When reading the next code in a stream, avoid reading an extra byte if
we're going to throw it away. When there's no more bits to extract from
the stream, bits will be 0 and we'll mask the read byte with 0 anyway.
At worst, this will avoid reading one past the end of gbuf array (which
is not possible in well formed streams).

PR: 127912
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D47041

(cherry picked from commit 818c7b769a4f7d3c8fecc4cf491f4e22ef816eba)
2024-10-11 16:11:02 -06:00
..
doc Remove $FreeBSD$: one-line bare tag 2023-08-16 11:55:20 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
compress.1 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
compress.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
zopen.3 Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
zopen.c uncompress: Avoid reading an extra byte 2024-10-11 16:11:02 -06:00
zopen.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00