Index: net/http/http_chunked_decoder.cc |
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc |
index d5b16ddb6ea738ae4530e7d33b74ba06de66f336..917ac494752767496f16d49245a0c90f5c29ff1b 100644 |
--- a/net/http/http_chunked_decoder.cc |
+++ b/net/http/http_chunked_decoder.cc |
@@ -187,12 +187,14 @@ bool HttpChunkedDecoder::ParseChunkSize(const char* start, int len, int* out) { |
// Be more restrictive than HexStringToInt; |
// don't allow inputs with leading "-", "+", "0x", "0X" |
- if (base::StringPiece(start, len).find_first_not_of("0123456789abcdefABCDEF") |
- != base::StringPiece::npos) |
+ base::StringPiece chunk_size(start, len); |
+ if (chunk_size.find_first_not_of("0123456789abcdefABCDEF") |
+ != base::StringPiece::npos) { |
return false; |
+ } |
int parsed_number; |
- bool ok = base::HexStringToInt(start, start + len, &parsed_number); |
+ bool ok = base::HexStringToInt(chunk_size, &parsed_number); |
if (ok && parsed_number >= 0) { |
*out = parsed_number; |
return true; |