Skip to content

Guard against uint32 overflow in byte-block skip/read limit checks#914

Open
hyder365 wants to merge 1 commit into
xiph:masterfrom
hyder365:fix-bitreader-overflow
Open

Guard against uint32 overflow in byte-block skip/read limit checks#914
hyder365 wants to merge 1 commit into
xiph:masterfrom
hyder365:fix-bitreader-overflow

Conversation

@hyder365

@hyder365 hyder365 commented Jun 19, 2026

Copy link
Copy Markdown

FLAC__bitreader_skip_byte_block_aligned_no_crc and
FLAC__bitreader_read_byte_block_aligned_no_crc both compute
nvals*8 without overflow protection. Values large enough to
overflow are unreachable through current callers (metadata block
length is at most 24 bits), but the overflow would silently disable
the limit enforcement. Pre-check the multiplication against
UINT32_MAX/8 before computing nvals*8.

FLAC__bitreader_skip_byte_block_aligned_no_crc and
FLAC__bitreader_read_byte_block_aligned_no_crc both compute
nvals*8 without overflow protection.  Values large enough to
overflow are unreachable through current callers (metadata block
length is at most 24 bits), but the overflow would silently disable
the limit enforcement.  Pre-check the multiplication against
UINT32_MAX/8 before computing nvals*8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant