impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Hecht (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-5031: remove undefined behavior: call to strncmp with nullptr
Date Tue, 02 May 2017 20:29:19 GMT
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 <jbapple-impala@apache.org>
Gerrit-Reviewer: Alex Behm <alex.behm@cloudera.com>
Gerrit-Reviewer: Attila Jeges <attilaj@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Jim Apple <jbapple-impala@apache.org>
Gerrit-HasComments: Yes

Mime
View raw message