Skip to content

Fix compressed block size validation - #566

Merged
slabko merged 2 commits into
ClickHouse:masterfrom
fallintoplace:fix/compressed-input-header-size
Sep 21, 2026
Merged

slabko merged 2 commits into
ClickHouse:masterfrom
fallintoplace:fix/compressed-input-header-size

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

What

  • Reject compressed blocks smaller than the 9-byte header.

Why

  • The size comes from the wire.
  • A value below 9 underflows compressed - HEADER_SIZE.
  • This can make the payload read write past the temporary buffer.

Implementation

  • Validate the lower bound before creating the temporary buffer.
  • Add regression coverage for sizes 0, 1, and 8.

@slabko
slabko merged commit d865a84 into ClickHouse:master Sep 21, 2026
44 checks passed
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.

2 participants