diff options
Diffstat (limited to 'src/core/transport/chttp2/hpack_parser.c')
-rw-r--r-- | src/core/transport/chttp2/hpack_parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c index f806f59ed7..93a452f1fd 100644 --- a/src/core/transport/chttp2/hpack_parser.c +++ b/src/core/transport/chttp2/hpack_parser.c @@ -1085,7 +1085,8 @@ static int parse_string_prefix(grpc_chttp2_hpack_parser *p, static void append_bytes(grpc_chttp2_hpack_parser_string *str, const gpr_uint8 *data, size_t length) { if (length + str->length > str->capacity) { - str->capacity = str->length + length; + GPR_ASSERT(str->length + length <= GPR_UINT32_MAX); + str->capacity = (gpr_uint32)(str->length + length); str->str = gpr_realloc(str->str, str->capacity); } memcpy(str->str + str->length, data, length); |