Tim Armstrong has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/11286 )

Change subject: IMPALA-6844: Fix possible NULL dereference in to_date() builtin
......................................................................

IMPALA-6844: Fix possible NULL dereference in to_date() builtin

If result.ptr allocation fails for some reason inside the StringVal
constructor, we still overwrite result.len and continue.

This change checks that the StringVal pointer is not NULL before
dereferencing it, and returns NULL if it is.

Testing: Added a test case of the to_date() function to
alloc-fail-init.test to leverage the fault injector
 --stress_fn_ctx_alloc.

Change-Id: I14cfb29a592885bb2f39958c8644f93db5220a68
Reviewed-on: http://gerrit.cloudera.org:8080/11286
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com>
---
M be/src/exprs/timestamp-functions-ir.cc
M testdata/workloads/functional-query/queries/QueryTest/alloc-fail-init.test
2 files changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Tim Armstrong: Looks good to me, approved

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I14cfb29a592885bb2f39958c8644f93db5220a68
Gerrit-Change-Number: 11286
Gerrit-PatchSet: 4
Gerrit-Owner: Vincent Tran <vtt...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>

Reply via email to