mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 19:08:59 +00:00
Add specially crafted test cases for EOF error
This replaces a PDF from the wild that I didn't want to include in the test suite but used to verify the original fix.
This commit is contained in:
parent
29e9c34fe3
commit
3c4110184c
5
TODO
5
TODO
@ -5,11 +5,6 @@ Next
|
||||
mention in latest release notes including that it was inadvertently
|
||||
left out of the release notes for 3.0.0.
|
||||
|
||||
* EOF while reading token causes a tokenizer error even when a valid
|
||||
token is ready. This can happen in an object stream if there is no
|
||||
newline or whitespace character at the end and the last token in
|
||||
the object stream is not an array or dictionary.
|
||||
|
||||
|
||||
General
|
||||
=======
|
||||
|
@ -149,7 +149,7 @@ $td->runtest("remove page we don't have",
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
# ----------
|
||||
$td->notify("--- Miscellaneous Tests ---");
|
||||
$n_tests += 45;
|
||||
$n_tests += 47;
|
||||
|
||||
$td->runtest("qpdf version",
|
||||
{$td->COMMAND => "qpdf --version"},
|
||||
@ -374,6 +374,14 @@ $td->runtest("parse objects from string",
|
||||
{$td->COMMAND => "test_driver 31 minimal.pdf"}, # file not used
|
||||
{$td->FILE => "parse-object.out", $td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
$td->runtest("EOF terminating literal tokens",
|
||||
{$td->COMMAND => "qpdf --check eof-terminates-literal.pdf"},
|
||||
{$td->FILE => "eof-terminates-literal.out", $td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
$td->runtest("EOF reading token",
|
||||
{$td->COMMAND => "qpdf --check eof-reading-token.pdf"},
|
||||
{$td->FILE => "eof-reading-token.out", $td->EXIT_STATUS => 0},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
|
||||
show_ntests();
|
||||
# ----------
|
||||
|
5
qpdf/qtest/qpdf/eof-reading-token.out
Normal file
5
qpdf/qtest/qpdf/eof-reading-token.out
Normal file
@ -0,0 +1,5 @@
|
||||
checking eof-reading-token.pdf
|
||||
PDF Version: 1.3
|
||||
File is not encrypted
|
||||
File is not linearized
|
||||
object stream 12 (file position 5): EOF while reading token
|
BIN
qpdf/qtest/qpdf/eof-reading-token.pdf
Normal file
BIN
qpdf/qtest/qpdf/eof-reading-token.pdf
Normal file
Binary file not shown.
6
qpdf/qtest/qpdf/eof-terminates-literal.out
Normal file
6
qpdf/qtest/qpdf/eof-terminates-literal.out
Normal file
@ -0,0 +1,6 @@
|
||||
checking eof-terminates-literal.pdf
|
||||
PDF Version: 1.3
|
||||
File is not encrypted
|
||||
File is not linearized
|
||||
No syntax or stream encoding errors found; the file may still contain
|
||||
errors that qpdf cannot detect
|
BIN
qpdf/qtest/qpdf/eof-terminates-literal.pdf
Normal file
BIN
qpdf/qtest/qpdf/eof-terminates-literal.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user