Chromium Code Reviews| 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..0dd5fc0e14204dc881215bd257f8d265c4e404de 100644 |
| --- a/net/spdy/hpack_huffman_table.cc |
| +++ b/net/spdy/hpack_huffman_table.cc |
| @@ -56,10 +56,12 @@ HpackHuffmanTable::~HpackHuffmanTable() {} |
| bool HpackHuffmanTable::Initialize(const HpackHuffmanSymbol* input_symbols, |
| size_t symbol_count) { |
| CHECK(!IsInitialized()); |
| + if (symbol_count > std::numeric_limits<uint16>::max()) |
| + return false; |
|
Bence
2014/12/01 18:18:38
Could this be a DCHECK to document requirements?
Peter Kasting
2014/12/02 02:13:55
Changed to a DCHECK and added a note to the declar
|
| 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; |