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

Unified Diff: net/spdy/hpack_huffman_table.cc

Issue 786123002: Update from https://crrev.com/307330 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/hpack_huffman_table.h ('k') | net/spdy/hpack_huffman_table_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « net/spdy/hpack_huffman_table.h ('k') | net/spdy/hpack_huffman_table_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698