Commit abb3191c32adb982a0a80e1b76976d34f4df3788

Authored by Jay Berkenbilt
1 parent e999bbae

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.
qpdf/qtest/qpdf.test
... ... @@ -222,6 +222,8 @@ my @bug_tests = (
222 222 ["141b", "/W entry size 0", 2],
223 223 ["143", "self-referential ostream", 3],
224 224 ["146", "very deeply nested array", 2],
  225 + ["147", "previously caused memory error", 2],
  226 + ["148", "free memory on bad flate", 2],
225 227 ["149", "xref prev pointer loop", 3],
226 228 );
227 229 $n_tests += scalar(@bug_tests);
... ...
qpdf/qtest/qpdf/issue-147.out 0 → 100644
  1 +WARNING: issue-147.pdf: can't find PDF header
  2 +WARNING: issue-147.pdf: file is damaged
  3 +WARNING: issue-147.pdf: can't find startxref
  4 +WARNING: issue-147.pdf: Attempting to reconstruct cross-reference table
  5 +WARNING: issue-147.pdf (trailer, file position 9): expected dictionary key but found non-name object; inserting key /QPDFFake1
  6 +WARNING: issue-147.pdf (object 62 0, file position 88): expected endobj
  7 +WARNING: issue-147.pdf (trailer, file position 90): invalid /ID in trailer dictionary
  8 +issue-147.pdf: invalid password
... ...
qpdf/qtest/qpdf/issue-147.pdf 0 → 100644
  1 +trailer<<<>/Encrypt 62 0 R>>
  2 +62 0 obj<</Filter/Standard/Length 160/O<>/P 0/R 3/U<>/V 2>>0 0
0 3 \ No newline at end of file
... ...
qpdf/qtest/qpdf/issue-148.out 0 → 100644
  1 +WARNING: issue-148.pdf: can't find PDF header
  2 +WARNING: issue-148.pdf (xref stream: object 8 0, file position 26): stream dictionary lacks /Length key
  3 +WARNING: issue-148.pdf (xref stream: object 8 0, file position 73): attempting to recover stream length
  4 +WARNING: issue-148.pdf (xref stream: object 8 0, file position 73): recovered stream length: 2
  5 +WARNING: issue-148.pdf (xref stream: object 8 0, file position 85): expected endobj
  6 +WARNING: issue-148.pdf (file position 73): error decoding stream data for object 8 0: stream inflate: inflate: data: incorrect header check
  7 +getStreamData called on unfilterable stream
... ...
qpdf/qtest/qpdf/issue-148.pdf 0 → 100644
No preview for this file type