diff --git a/lib/nghttp2_hd_huffman.c b/lib/nghttp2_hd_huffman.c index 4fe3a07d..c1713ddf 100644 --- a/lib/nghttp2_hd_huffman.c +++ b/lib/nghttp2_hd_huffman.c @@ -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; }