Subject: | Bad PDF Spins CPU |
Date: | Tue, 18 Aug 2009 10:15:38 -0400 |
To: | <bug-pdf-reuse [...] rt.cpan.org> |
From: | Matt Gardner <four_7_12 [...] hotmail.com> |
When an xref points past the end of the document, PDF::Reuse spins the cpu.
PDF::Reuse 0.35Perl 5.8.8RHEL 5 2.6.18-128.el5
Patch:In Reuse.pm@@ -4180,6 +4180,7 @@ } if ($buf =~ m'\bstartxref\s+(\d+)'o) { $xref = $1;+ die "Invallid XREF" if $xref > $bytes; while ($xref) { $res = sysseek INFIL, $xref, 0; $res = sysread INFIL, $buf, 200;
Maybe there is some way to gracefully recover here, but I don't know what that would be.
-Matt
Show quoted text
_________________________________________________________________
Windows Live: Make it easier for your friends to see what you’re up to on Facebook.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_facebook:082009