Dan Hecht has posted comments on this change. Change subject: IMPALA-5031: remove undefined behavior: call to strncmp with nullptr ......................................................................
Patch Set 1: Code-Review+2 (1 comment) http://gerrit.cloudera.org:8080/#/c/6767/1/be/src/runtime/string-value.inline.h File be/src/runtime/string-value.inline.h: Line 59: const int result = len > 0 ? strncmp(s1, s2, len) : 0; > Example backtrace: How about a short comment explaining strncmp() is undefined for nullptrs. Some day, we may change things at a lower level so that even when str.len == 0, we have a non-null str.ptr, so we can avoid these checks. And so it would be good to leave a hint that this branch can be removed at that time. -- To view, visit http://gerrit.cloudera.org:8080/6767 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id563e81720a0a4847664fa2828ecfdcad870da5b Gerrit-PatchSet: 1 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Jim Apple <[email protected]> Gerrit-Reviewer: Alex Behm <[email protected]> Gerrit-Reviewer: Attila Jeges <[email protected]> Gerrit-Reviewer: Dan Hecht <[email protected]> Gerrit-Reviewer: Jim Apple <[email protected]> Gerrit-HasComments: Yes
