File tree 1 file changed +15
-1
lines changed 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -702,8 +702,22 @@ test "empty distance alphabet" {
702
702
703
703
test "inflateStream fuzzing" {
704
704
// see https://github.com/ziglang/zig/issues/9842
705
- try std .testing .expectError (error .EndOfStream , testInflate ("\x95 0000 " ));
705
+ try std .testing .expectError (error .EndOfStream , testInflate ("\x95\x90 =o \xc2 0 \x10\x86\xf3 0 " ));
706
706
try std .testing .expectError (error .OutOfCodes , testInflate ("\x95 0\x00\x00 00000" ));
707
+
708
+ // Huffman.construct errors
709
+ // lencode
710
+ try std .testing .expectError (error .InvalidTree , testInflate ("\x95 0000" ));
711
+ try std .testing .expectError (error .InvalidTree , testInflate ("\x05 000" ));
712
+ // hlen
713
+ try std .testing .expectError (error .InvalidTree , testInflate ("\x05\xea\x01 \t \x00\x00\x00\x01\x00 \\ \xbf .\t \x00 " ));
714
+ // hdist
715
+ try std .testing .expectError (error .InvalidTree , testInflate ("\x05\xe0\x01 A\x00\x00\x00\x00\x10 \\ \xbf ." ));
716
+
717
+ // Huffman.construct -> error.IncompleteSet returns that shouldn't give error.InvalidTree
718
+ // (like the "empty distance alphabet" test but for ndist instead of nlen)
719
+ try std .testing .expectError (error .EndOfStream , testInflate ("\x05\xe0\x01 \t \x00\x00\x00\x00\x10 \\ \xbf\xce " ));
720
+ try testInflate ("\x15\xe0\x01 \t \x00\x00\x00\x00\x10 \\ \xbf .0" );
707
721
}
708
722
709
723
fn testInflate (data : []const u8 ) ! void {
You can’t perform that action at this time.
0 commit comments