Assert ctx->state >= 0 in huffman decoding

This commit is contained in:
Tatsuhiro Tsujikawa 2014-05-28 00:30:11 +09:00
parent 86ab9f33de
commit 5e6a2fa256
1 changed files with 5 additions and 1 deletions

View File

@ -177,7 +177,11 @@ ssize_t nghttp2_hd_huff_decode(nghttp2_hd_huff_decode_context *ctx,
for(i = 0; i < srclen; ++i) {
uint8_t in = src[i] >> 4;
for(j = 0; j < 2; ++j) {
const nghttp2_huff_decode *t = &huff_decode_table[ctx->state][in];
const nghttp2_huff_decode *t;
assert(ctx->state >= 0);
t = &huff_decode_table[ctx->state][in];
if(t->state == -1) {
return NGHTTP2_ERR_HEADER_COMP;
}