Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash on call dictGet() with bad arguments. #25913

Conversation

vitlibar
Copy link
Member

@vitlibar vitlibar commented Jul 2, 2021

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Changelog category:

  • Bug Fix

Changelog entry:
Fix crash on call dictGet() with bad arguments.

This PR fixes #25533

@robot-clickhouse robot-clickhouse added the pr-bugfix Pull request with bugfix, not backported by default label Jul 2, 2021
@vitlibar vitlibar force-pushed the fix-crash-on-dictget-with-bad-argument branch 2 times, most recently from 318ef7b to 3e72dcf Compare July 2, 2021 11:33
auto opt_name = tryGetIdentifierName(ast);
if (opt_name && !data.aliases.count(*opt_name) && ast->as<ASTIdentifier>())
{
ptr->as<ASTFunction>()->arguments->children[0] = ast->as<ASTIdentifier>()->createTable();
Copy link
Member Author

@vitlibar vitlibar Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The crash was because of this line: the function createTable() returned nullptr, assert() didn't alert on that in release, and then InDepthNodeVisitor::visitChildren() tried to iterate through a null child.

@vitlibar vitlibar force-pushed the fix-crash-on-dictget-with-bad-argument branch from 3e72dcf to 8b4fabe Compare July 2, 2021 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Pull request with bugfix, not backported by default
Projects
None yet
3 participants