Summary: |
pdfinfo hangs when a corrupt file is piped in via stdin |
Product: |
poppler
|
Reporter: |
Nathan Peck <nathan> |
Component: |
utils | Assignee: |
poppler-bugs <poppler-bugs> |
Status: |
RESOLVED
FIXED
|
QA Contact: |
|
Severity: |
major
|
|
|
Priority: |
medium
|
|
|
Version: |
unspecified | |
|
Hardware: |
x86-64 (AMD64) | |
|
OS: |
Mac OS X (All) | |
|
Whiteboard: |
|
i915 platform:
|
|
i915 features:
|
|
Attachments: |
A bad PDF file
|
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 79774 [details] A bad PDF file When pdfinfo receives a corrupt file that is piped in via stdin it hangs with 100% CPU usage. Example Usage: cat damaged.pdf | pdfinfo - Output: Syntax Warning: May not be a PDF file (continuing anyway) Expected outcome: The program should terminate after determining that the file is corrupt Actual outcome: After outputting the one error message it never terminates and sits there using 100% of the CPU. It is worth noting that when pdfinfo is invoked with the exact same file via: pdfinfo damaged.pdf instead of piping the corrupt PDF in via stdin then this problem does not happen and the output is: Syntax Warning: May not be a PDF file (continuing anyway) Syntax Error: Couldn't find trailer dictionary Syntax Error: Couldn't read xref table Then the process terminates as expected. I have attached the bad file that I am using to test with and recreate this issue.