Add tests for previous memory issues

Now that the test suite runs clean with address sanitizer, add some
test cases that previously were used to expose memory errors.
This commit is contained in:
Jay Berkenbilt 2017-08-28 22:07:20 -04:00
parent e999bbae43
commit abb3191c32
5 changed files with 19 additions and 0 deletions

View File

@ -222,6 +222,8 @@ my @bug_tests = (
["141b", "/W entry size 0", 2],
["143", "self-referential ostream", 3],
["146", "very deeply nested array", 2],
["147", "previously caused memory error", 2],
["148", "free memory on bad flate", 2],
["149", "xref prev pointer loop", 3],
);
$n_tests += scalar(@bug_tests);

View File

@ -0,0 +1,8 @@
WARNING: issue-147.pdf: can't find PDF header
WARNING: issue-147.pdf: file is damaged
WARNING: issue-147.pdf: can't find startxref
WARNING: issue-147.pdf: Attempting to reconstruct cross-reference table
WARNING: issue-147.pdf (trailer, file position 9): expected dictionary key but found non-name object; inserting key /QPDFFake1
WARNING: issue-147.pdf (object 62 0, file position 88): expected endobj
WARNING: issue-147.pdf (trailer, file position 90): invalid /ID in trailer dictionary
issue-147.pdf: invalid password

View File

@ -0,0 +1,2 @@
trailer<<<>/Encrypt 62 0 R>>
62 0 obj<</Filter/Standard/Length 160/O<>/P 0/R 3/U<>/V 2>>0 0

View File

@ -0,0 +1,7 @@
WARNING: issue-148.pdf: can't find PDF header
WARNING: issue-148.pdf (xref stream: object 8 0, file position 26): stream dictionary lacks /Length key
WARNING: issue-148.pdf (xref stream: object 8 0, file position 73): attempting to recover stream length
WARNING: issue-148.pdf (xref stream: object 8 0, file position 73): recovered stream length: 2
WARNING: issue-148.pdf (xref stream: object 8 0, file position 85): expected endobj
WARNING: issue-148.pdf (file position 73): error decoding stream data for object 8 0: stream inflate: inflate: data: incorrect header check
getStreamData called on unfilterable stream

Binary file not shown.