mirror of
https://github.com/apache/impala.git
synced 2026-01-03 06:00:52 -05:00
AllocBuffer() and CopyStringVal() are two helper functions used by various UDAs to allocate buffers for StringVal during their Init() and Update() functions. Previously, these functions assumed that the buffer length is always greater than 0. That turned out to be an invalid assumption. This change removes this assumption and handles zero-length StringVal by initializing its 'ptr' to NULL and 'len' to 0. A new test is also added to exercise this case. Change-Id: Ia1e4140376c65ca3c734c40ecc3cce15b8bf2d3f Reviewed-on: http://gerrit.cloudera.org:8080/2211 Reviewed-by: Dan Hecht <dhecht@cloudera.com> Tested-by: Internal Jenkins
29 KiB
29 KiB