Merge pull request #18164 from yang-g/overflow

Prevent overflow
pull/18181/head
Yang Gao 6 years ago committed by GitHub
commit e673264321
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/core/ext/transport/chttp2/transport/hpack_parser.cc

@ -1452,7 +1452,7 @@ static grpc_error* begin_parse_string(grpc_chttp2_hpack_parser* p,
uint8_t binary,
grpc_chttp2_hpack_parser_string* str) {
if (!p->huff && binary == NOT_BINARY &&
(end - cur) >= static_cast<intptr_t>(p->strlen) &&
static_cast<uint32_t>(end - cur) >= p->strlen &&
p->current_slice_refcount != nullptr) {
GRPC_STATS_INC_HPACK_RECV_UNCOMPRESSED();
str->copied = false;

Loading…
Cancel
Save