You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Adar Dembo (Code Review)" <ge...@cloudera.org> on 2019/11/01 00:21:36 UTC

[kudu-CR] gutil/strings: fix UB in FindNth

Hello Alexey Serbin, Kudu Jenkins, Andrew Wong, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/14585

to look at the new patch set (#2).

Change subject: gutil/strings: fix UB in FindNth
......................................................................

gutil/strings: fix UB in FindNth

It's not OK to overflow an unsigned type (size_t) in this way. Newer
versions of the code (in other Google codebases) address the problem by
using an int instead of size_t, so we'll do the same thing too.

  src/kudu/gutil/strings/util.cc:1030:34: runtime error: unsigned integer overflow: 18446744073709551615 + 1 cannot be represented in type 'unsigned long'
    #0 0x7fcee8a0798e in FindNth(StringPiece, char, int) /src/kudu/gutil/strings/util.cc:1030:34

Change-Id: I00a36f999a8c3b13469600b785da95c487643d4a
---
M src/kudu/gutil/strings/string_util-test.cc
M src/kudu/gutil/strings/util.cc
2 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/85/14585/2
-- 
To view, visit http://gerrit.cloudera.org:8080/14585
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I00a36f999a8c3b13469600b785da95c487643d4a
Gerrit-Change-Number: 14585
Gerrit-PatchSet: 2
Gerrit-Owner: Adar Dembo <ad...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)