Page MenuHomeFreeBSD

uncompress: Avoid reading an extra byte
ClosedPublic

Authored by imp on Oct 10 2024, 5:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 11, 9:39 PM
Unknown Object (File)
Sat, Oct 11, 9:39 PM
Unknown Object (File)
Sat, Oct 11, 9:39 PM
Unknown Object (File)
Sat, Oct 11, 12:30 PM
Unknown Object (File)
Thu, Oct 9, 10:06 AM
Unknown Object (File)
Wed, Oct 1, 2:22 AM
Unknown Object (File)
Fri, Sep 26, 11:36 AM
Unknown Object (File)
Wed, Sep 24, 5:57 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