Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/18629 )

Change subject: IMPALA-11365: Dereferencing null pointer in TopNNode
......................................................................

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 <borokna...@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
---
M be/src/exec/topn-node.cc
M be/src/util/tuple-row-compare.h
2 files changed, 34 insertions(+), 1 deletion(-)

Approvals:
  Zoltan Borok-Nagy: Looks good to me, approved
  Impala Public Jenkins: Verified

--
To view, visit http://gerrit.cloudera.org:8080/18629
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0b15b06f608b4d17fdf8a24e05967aaa16ebb79c
Gerrit-Change-Number: 18629
Gerrit-PatchSet: 6
Gerrit-Owner: Daniel Becker <daniel.bec...@cloudera.com>
Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com>
Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com>

Reply via email to