| Index: net/spdy/hpack_huffman_table.cc
|
| diff --git a/net/spdy/hpack_huffman_table.cc b/net/spdy/hpack_huffman_table.cc
|
| index 9e8f6a1f7830f020d203add1d7b6e10f968bde60..d9cff25239a72e86c988dbc88f5b6204b30a05ab 100644
|
| --- a/net/spdy/hpack_huffman_table.cc
|
| +++ b/net/spdy/hpack_huffman_table.cc
|
| @@ -8,6 +8,7 @@
|
| #include <cmath>
|
|
|
| #include "base/logging.h"
|
| +#include "base/numerics/safe_conversions.h"
|
| #include "net/spdy/hpack_input_stream.h"
|
| #include "net/spdy/hpack_output_stream.h"
|
|
|
| @@ -56,10 +57,11 @@ HpackHuffmanTable::~HpackHuffmanTable() {}
|
| bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols,
|
| size_t symbol_count) {
|
| CHECK(!IsInitialized());
|
| + DCHECK(base::IsValueInRangeForNumericType<uint16>(symbol_count));
|
|
|
| std::vector<Symbol> symbols(symbol_count);
|
| // Validate symbol id sequence, and copy into |symbols|.
|
| - for (size_t i = 0; i != symbol_count; i++) {
|
| + for (uint16 i = 0; i < symbol_count; i++) {
|
| if (i != input_symbols[i].id) {
|
| failed_symbol_id_ = i;
|
| return false;
|
|
|