HomeFreeBSD

uncompress: Avoid reading an extra byte

Description

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

Details

Provenance
David Jones <drj@ravenbrook.com>Authored on Fri, Oct 11, 3:49 PM
impCommitted on Fri, Oct 11, 3:50 PM
Reviewer
emaste
Differential Revision
D47041: uncompress: Avoid reading an extra byte
Parents
rG6cde8f3ef7cd: lpd: Tighten permissions on /var/run/printer
Branches
Unknown
Tags
Unknown