Michael Smith has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/24474 )

Change subject: IMPALA-13870: Add operator<< for StringVal to prevent unsafe 
ptr usage
......................................................................

IMPALA-13870: Add operator<< for StringVal to prevent unsafe ptr usage

StringVal buffers are not null-terminated, but manual string
construction from ptr/len is error-prone. This change adds a
length-safe stream operator that handles NULL values and
non-terminated buffers correctly.

The operator uses ostream::write(ptr, len) to ensure only len bytes
are printed, never relying on null termination.

Testing:
- Added unit tests including special cases for NULL, empty,
  non-terminated, and embedded-null cases

Change-Id: I2dd226d69fee428b5b38bdbf84dc73de4293c81b
Reviewed-on: http://gerrit.cloudera.org:8080/24474
Reviewed-by: Peter Rozsa <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Michael Smith <[email protected]>
---
M be/src/udf/udf-test.cc
M be/src/udf/udf.h
2 files changed, 53 insertions(+), 1 deletion(-)

Approvals:
  Peter Rozsa: Looks good to me, but someone else must approve
  Impala Public Jenkins: Verified
  Michael Smith: Looks good to me, approved

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2dd226d69fee428b5b38bdbf84dc73de4293c81b
Gerrit-Change-Number: 24474
Gerrit-PatchSet: 3
Gerrit-Owner: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>

Reply via email to