Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(641)

Issue 1685743006: StringToUint should output zero on negative numbers. (Closed)

Created:
4 years, 10 months ago by davidben
Modified:
4 years, 10 months ago
Reviewers:
Nico
CC:
chromium-reviews, jshin+watch_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

StringToUint should output zero on negative numbers. The StringToFoo family of functions are documented to, on underflow, write the minimum supported value (and return false). However, on negative numbers codepath for unsigned integers, it doesn't write to *output at all. There is actually a test for this case, but because output is initialized to zero, the tests don't catch it. Fix that codepath and make sure the tests notice if StringToUint doesn't write anything. BUG=none Committed: https://crrev.com/301864e18afd79be3857c6101cf856a45016f71f Cr-Commit-Position: refs/heads/master@{#378057}

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+6 lines, -4 lines) Patch
M base/strings/string_number_conversions.cc View 1 chunk +1 line, -0 lines 4 comments Download
M base/strings/string_number_conversions_unittest.cc View 2 chunks +5 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (6 generated)
davidben
4 years, 10 months ago (2016-02-11 21:36:11 UTC) #2
Nico
lgtm, but i think there's more if you want: https://codereview.chromium.org/1685743006/diff/1/base/strings/string_number_conversions.cc File base/strings/string_number_conversions.cc (right): https://codereview.chromium.org/1685743006/diff/1/base/strings/string_number_conversions.cc#newcode143 base/strings/string_number_conversions.cc:143: ...
4 years, 10 months ago (2016-02-11 21:40:31 UTC) #3
davidben
https://codereview.chromium.org/1685743006/diff/1/base/strings/string_number_conversions.cc File base/strings/string_number_conversions.cc (right): https://codereview.chromium.org/1685743006/diff/1/base/strings/string_number_conversions.cc#newcode143 base/strings/string_number_conversions.cc:143: valid = false; On 2016/02/11 21:40:31, Nico wrote: > ...
4 years, 10 months ago (2016-02-11 21:47:22 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1685743006/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1685743006/1
4 years, 10 months ago (2016-02-26 19:27:48 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/29951)
4 years, 10 months ago (2016-02-26 22:17:36 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1685743006/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1685743006/1
4 years, 10 months ago (2016-02-26 23:09:54 UTC) #11
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 10 months ago (2016-02-27 01:31:20 UTC) #12
commit-bot: I haz the power
4 years, 10 months ago (2016-02-27 01:32:32 UTC) #14
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/301864e18afd79be3857c6101cf856a45016f71f
Cr-Commit-Position: refs/heads/master@{#378057}

Powered by Google App Engine
This is Rietveld 408576698