You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2022/07/02 03:28:00 UTC
[jira] [Commented] (IMPALA-11365) Dereferencing null pointer in TopNNode
[ https://issues.apache.org/jira/browse/IMPALA-11365?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17561671#comment-17561671 ]
ASF subversion and git services commented on IMPALA-11365:
----------------------------------------------------------
Commit da14fdcf35da28d2ff86c6ca9413a95cc3f8f346 in impala's branch refs/heads/dependabot/pip/infra/python/deps/urllib3-1.26.5 from Daniel Becker
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=da14fdcf3 ]
IMPALA-11365: Dereferencing null pointer in TopNNode
In the constructor of TopNNode, if 'pnode.partition_comparator_config_'
is NULL, we initialise 'partition_cmp_' with a NULL pointer. However,
when initialising 'partition_heaps_', we dereference 'partition_cmp_'
because 'ComparatorWrapper' expects a reference.
This has so far not lead to a crash because in this case the comparator
of 'partition_heaps_' is not used, but assigning a NULL pointer to a
reference is undefined behaviour.
After this change, instead of assigning a NULL pointer to
'partition_cmp_', we use a dummy comparator, and no undefined behaviour
is invoked.
Change-Id: I0b15b06f608b4d17fdf8a24e05967aaa16ebb79c
Reviewed-on: http://gerrit.cloudera.org:8080/18629
Reviewed-by: Zoltan Borok-Nagy <bo...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
> Dereferencing null pointer in TopNNode
> --------------------------------------
>
> Key: IMPALA-11365
> URL: https://issues.apache.org/jira/browse/IMPALA-11365
> Project: IMPALA
> Issue Type: Bug
> Reporter: Daniel Becker
> Assignee: Daniel Becker
> Priority: Major
>
> In the constructor of TopNNode, if {{pnode.partition_comparator_config_}} is NULL, we initialise {{partition_cmp_}} with a NULL pointer. However, when initialising {{{}partition_heaps_{}}}, we dereference {{partition_cmp_}} because {{ComparatorWrapper}} expects a reference.
> This has so far not lead to a crash because in this case the comparator of {{partition_heaps_}} is not used, but assigning a NULL pointer to a reference is undefined behaviour.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org