Repository navigation
Bound column count in inserted RowBinary header - #120282
Merged
Merged
Conversation
BinaryFormatReader read the header column count with readVarUInt and used it unbounded as a loop bound in readHeaderRow and as a reserve() argument in readTypes. readVarUInt limits the bytes consumed, not the decoded value, so an INSERT ... FORMAT RowBinaryWithNamesAndTypes could amplify a small upload into a large server-side allocation. Reject a header column count above DEFAULT_NATIVE_BINARY_MAX_NUM_COLUMNS with TOO_LARGE_ARRAY_SIZE at all three read sites (readNames, skipNames, skipTypes), matching the existing check in NativeReader and MsgPackRowInputFormat. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Contributor
|
Workflow [PR], commit [7c22790] Summary: ❌
AI ReviewSummaryThis PR bounds the Missing context / blind spots
Final Verdict✅ No actionable review findings in the current version of this PR. LLVM Coverage ReportMeasured on commit 7c22790.
Changed lines: Changed C/C++ lines covered: 5/13 (38.46%) · Uncovered code |
Member
|
@Avogar Maybe you like to take a look at this PR? |
This was referenced Sep 24, 2026
clickhouse-gh Bot
added a commit
that referenced
this pull request
Sep 24, 2026
Backport #120282 to 26.8: Bound column count in inserted RowBinary header
clickhouse-gh Bot
added a commit
that referenced
this pull request
Sep 24, 2026
Backport #120282 to 26.9: Bound column count in inserted RowBinary header
clickhouse-gh Bot
added a commit
that referenced
this pull request
Sep 24, 2026
Backport #120282 to 26.7: Bound column count in inserted RowBinary header
kewin-robetti
pushed a commit
to viasoftkorp/ClickHouse
that referenced
this pull request
Sep 25, 2026
…wBinary header
PedroTadim
added a commit
that referenced
this pull request
Sep 25, 2026
Backport #120282 to 26.3: Bound column count in inserted RowBinary header
kewin-robetti
pushed a commit
to viasoftkorp/ClickHouse
that referenced
this pull request
Oct 2, 2026
…wBinary header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The column count in the
RowBinaryWithNames[AndTypes]header was read withreadVarUIntand used unbounded as a loop bound inreadHeaderRowand as areserveargument inreadTypes.readVarUIntlimits the number of bytes consumed, not the decoded value, so anINSERT ... FORMAT RowBinaryWithNamesAndTypescould turn a small upload into a large server-side allocation.Reject a header column count above
DEFAULT_NATIVE_BINARY_MAX_NUM_COLUMNSwithTOO_LARGE_ARRAY_SIZEat all three read sites (readNames,skipNames,skipTypes), matching the existing check inNativeReaderandMsgPackRowInputFormat.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Bound the header column count in
RowBinaryformats to avoid excessive memory allocation from a crafted header.Workflow [PR]
Sync PR [sync-upstream/pr/120282]
Version info
26.10.1.635-master(included in26.10and later)26.9.2.33,26.8.11.41,26.7.14.40,26.3.33.144