Page MenuHomeFreeBSD

uncompress: Avoid reading an extra byte
ClosedPublic

Authored by imp on Oct 10 2024, 5:02 PM.
Tags
None
Referenced Files
F146225554: D47041.id.diff
Sat, Feb 28, 10:10 PM
Unknown Object (File)
Sat, Feb 21, 6:55 PM
Unknown Object (File)
Sun, Feb 8, 12:18 PM
Unknown Object (File)
Sun, Feb 8, 3:06 AM
Unknown Object (File)
Fri, Jan 30, 8:42 PM
Unknown Object (File)
Jan 30 2026, 1:03 AM
Unknown Object (File)
Dec 20 2025, 12:06 PM
Unknown Object (File)
Nov 29 2025, 12:11 PM
Subscribers
None

Details

Summary

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

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable