Todd Lipcon has submitted this change and it was merged.

Change subject: KUDU-815. Fix UBSAN error on Schemas with no columns
......................................................................


KUDU-815. Fix UBSAN error on Schemas with no columns

This fixes a UBSAN error when calling .data() on an empty vector. In theory,
the C++11 standard allows this, but it appears that our libstdcxx
implementation ends up implementing it on top of vector::front(), which returns
a NULL reference in the case of an empty array. This is, of course, undefined
behavior.

Change-Id: Ie79a430d2478320cd18e67a4e328111fe9afad30
Reviewed-on: http://gerrit.cloudera.org:8080/1789
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Todd Lipcon <[email protected]>
---
M src/kudu/common/id_mapping.cc
M src/kudu/common/schema.cc
M src/kudu/util/memenv/memenv.cc
3 files changed, 18 insertions(+), 5 deletions(-)

Approvals:
  Adar Dembo: Looks good to me, approved
  Todd Lipcon: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie79a430d2478320cd18e67a4e328111fe9afad30
Gerrit-PatchSet: 4
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Todd Lipcon <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>
Gerrit-Reviewer: Mike Percy <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>

Reply via email to