Skip to content

Commit a51cd04

Browse files
committed
Fix build errors in HTTP/2 Huffman decoder fuzzer
1 parent 842d001 commit a51cd04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib/lwan-h2-huffman.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ ssize_t lwan_h2_huffman_next(struct lwan_h2_huffman_decoder *huff)
367367
}
368368

369369
if (!consume(reader, 8))
370-
goto fail;
370+
return -1;
371371

372372
const struct h2_huffman_code *level3 = next_level2(peeked_byte);
373373
if (LIKELY(level3)) {
@@ -390,8 +390,9 @@ ssize_t lwan_h2_huffman_next(struct lwan_h2_huffman_decoder *huff)
390390
/* FIXME: ensure we're not promoting types unnecessarily here */
391391
if (reader->total_bitcount) {
392392
const uint8_t peeked_byte = peek_byte(reader);
393-
const uint8_t eos_prefix = ((1 << reader->total_bitcount) - 1)
394-
<< (8 - reader->total_bitcount);
393+
const uint8_t eos_prefix =
394+
(uint8_t)(((1u << reader->total_bitcount) - 1u)
395+
<< (8u - reader->total_bitcount));
395396

396397
if ((peeked_byte & eos_prefix) == eos_prefix)
397398
goto done;

0 commit comments

Comments
 (0)