Repository navigation
Fix null pointer dereference in dictGetOrDefault with nullable key - #98460
Merged
alexey-milovidov merged 1 commit intoMar 2, 2026
Merged
Conversation
…and short-circuit evaluation In `executeDictionaryRequest`, `restoreShortCircuitColumn` was using `result_type` (Nullable) as the column type for the dictionary result, but `dictionary->getColumn` returns a non-nullable column matching `attribute_type`. This type/column mismatch caused the `if` function's `executeForNullableThenElse` to call `recursiveGetNullMapFromNullable` on a non-nullable column, which returned nullptr. The null pointer was then passed as an argument to a recursive `executeImpl` call, triggering UBSan error / assertion failure. The fix uses `attribute_type` (non-nullable) instead of `result_type` in both `getDefaultsShortCircuit` and `restoreShortCircuitColumn`. The nullable wrapping is already handled by the outer `wrapInNullable` call. Closes #97968 https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=5a0a680930b0e1ff01cb47763825105938bad5b9&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_ubsan%29&name_1=AST%20fuzzer%20%28amd_ubsan%29 Co-Authored-By: Claude Opus 4.6 <[email protected]>
Contributor
alexey-milovidov
commented
Mar 2, 2026
| -- caused UBSan error (member call on null pointer) in the `if` function because | ||
| -- restoreShortCircuitColumn passed a non-nullable column with a Nullable type to `if`. | ||
|
|
||
| DROP TABLE IF EXISTS regexp_dictionary_source_table; |
Member
Author
There was a problem hiding this comment.
Yes, it reproduces!
1 task
robot-ch-test-poll3
added a commit
that referenced
this pull request
May 13, 2026
Cherry pick #98460 to 25.8: Fix null pointer dereference in dictGetOrDefault with nullable key
robot-clickhouse
added a commit
that referenced
this pull request
May 13, 2026
…ault with nullable key
robot-ch-test-poll3
added a commit
that referenced
this pull request
May 13, 2026
Cherry pick #98460 to 26.2: Fix null pointer dereference in dictGetOrDefault with nullable key
robot-clickhouse
added a commit
that referenced
this pull request
May 13, 2026
…ault with nullable key
mstetsyuk
added a commit
that referenced
this pull request
May 18, 2026
Backport #98460 to 26.2: Fix null pointer dereference in dictGetOrDefault with nullable key
mstetsyuk
added a commit
that referenced
this pull request
May 18, 2026
Backport #98460 to 25.8: Fix null pointer dereference in dictGetOrDefault with nullable key
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.
Linked issues
Summary
dictGetOrDefaultwith nullable key and short-circuit evaluationrestoreShortCircuitColumnwas passing a non-nullable dictionary result column with aNullabletype to theiffunction, causingexecuteForNullableThenElseto dereference a null pointer when extracting the null mapattribute_type(non-nullable) instead ofresult_type(nullable) for the short-circuit merge; the nullable wrapping is already handled by the outerwrapInNullablecallCloses #97968
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=5a0a680930b0e1ff01cb47763825105938bad5b9&name_0=MasterCI&name_1=AST%20fuzzer%20%28amd_ubsan%29&name_1=AST%20fuzzer%20%28amd_ubsan%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix null pointer dereference in
dictGetOrDefaultwhen the key argument isNullable.🤖 Generated with Claude Code
Version info
26.3.1.25826.2.19.32,25.8.24.18