Bug 85233

Summary: [pdfseparate] Near-eternal loop, 3 exabyte file output
Product: poppler Reporter: MH <ravdune+bugzilla>
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: disk-fill.pdf
check for EOF

Description MH 2014-10-20 11:24:26 UTC
Created attachment 108108 [details]
disk-fill.pdf

OS: Fedora 20 (running in virtualbox)
Dependencies installed with: yum-builddep poppler
Version: GIT Master
Command line for loop demonstration: master/utils/pdfseparate <attached.pdf> /dev/null
Command line for filling disk: master/utils/pdfseparate <attached.pdf> out-%d

Attached several files that repeat this, basically there's an output loop that attempts to write 3,695,785,924,655,524,693 bytes (3.6 exabytes) to disk. Should probably sanity check the size. Obviously minor bug.

  for (Goffset i = 0; i < length; i++) {
    int c = str->getUnfilteredChar();
    outStr->printf("%c", c);  
  }
  
  Here with attached file & command line length = 3695785924655524693
Comment 1 Adrian Johnson 2014-10-20 11:48:42 UTC
Created attachment 108113 [details] [review]
check for EOF
Comment 2 Thomas Freitag 2014-10-20 12:11:05 UTC
(In reply to Adrian Johnson from comment #1)
> Created attachment 108113 [details] [review] [review]
> check for EOF

Thanks, Adrian, looks well!
Comment 3 Carlos Garcia Campos 2014-10-20 17:44:51 UTC
Comment on attachment 108113 [details] [review]
check for EOF

Review of attachment 108113 [details] [review]:
-----------------------------------------------------------------

Looks good to me too.
Comment 4 Adrian Johnson 2014-10-21 09:48:12 UTC
Pushed

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.