Skip to content

Cherry pick #98460 to 25.8: Fix null pointer dereference in dictGetOrDefault with nullable key - #104796

Merged
robot-ch-test-poll3 merged 3 commits into
backport/25.8/98460from
cherrypick/25.8/98460
May 13, 2026
Merged

robot-ch-test-poll3 merged 3 commits into
backport/25.8/98460from
cherrypick/25.8/98460

Conversation

@robot-ch-test-poll3

Copy link
Copy Markdown
Contributor

Original pull-request #98460

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

alexey-milovidov and others added 3 commits March 2, 2026 03:58
…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]>
…le-short-circuit

Fix null pointer dereference in dictGetOrDefault with nullable key
@robot-ch-test-poll3 robot-ch-test-poll3 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels May 13, 2026
@robot-ch-test-poll3
robot-ch-test-poll3 merged commit 88c4333 into backport/25.8/98460 May 13, 2026
@robot-ch-test-poll3
robot-ch-test-poll3 deleted the cherrypick/25.8/98460 branch May 13, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants