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

Issue 7584031: base::HexStringToInt conversion function treats the string "0x" as a valid hex number (Closed)

Created:
9 years, 4 months ago by ali.akbar
Modified:
9 years, 4 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, jshin+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Fixes a corner case bug in the HexStringToInt conversion function which caused the string "0x" to be treated as a valid hexadecimal number. Although the parsed result was 0, the boolean flag returned indicated that the hex number was in proper format The IteratorRangeToNumber class's Invoke function increments the string pointer by 2 if the string starts with "0x" or "0X" and the length is greater than *or equal* to 2 If the length of the string is 2, i.e "0x", after the pointer increment, the string would be empty and the function returns true as the parse result Changed the condition from "greater than or equal to" to "greater than" Added another test cases which now properly treats "0x" as an invalid hex string Contributed by ali.akbar@gmail.com BUG=92054 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=96605

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

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

Messages

Total messages: 8 (0 generated)
ali.akbar_gmail.com
9 years, 4 months ago (2011-08-08 17:38:49 UTC) #1
erikwright (departed)
LGTM.
9 years, 4 months ago (2011-08-08 17:48:51 UTC) #2
ali.akbar_gmail.com
On 2011/08/08 17:48:51, erikwright wrote: > LGTM. Erik, Thank you for reviewing the patch. As ...
9 years, 4 months ago (2011-08-08 19:27:25 UTC) #3
ali.akbar_gmail.com
Erik, Could you pass this patch on to the try server? Thanks.
9 years, 4 months ago (2011-08-09 07:16:36 UTC) #4
erikwright (departed)
On 2011/08/09 07:16:36, Ali Akbar wrote: > Erik, Could you pass this patch on to ...
9 years, 4 months ago (2011-08-10 18:48:52 UTC) #5
Mark Mentovai
LGTM both for purposes of review and OWNERS approval.
9 years, 4 months ago (2011-08-12 17:44:00 UTC) #6
commit-bot: I haz the power
Change committed as 96605
9 years, 4 months ago (2011-08-12 20:13:23 UTC) #7
ali.akbar_gmail.com
9 years, 4 months ago (2011-08-12 20:17:56 UTC) #8
On 2011/08/12 17:44:00, Mark Mentovai wrote:
> LGTM both for purposes of review and OWNERS approval.

Hi Mark / Erik,
  Thanks for the review

Ali

Powered by Google App Engine
This is Rietveld 408576698