[poppler] invalid option can cause SEGV in pdftocairo

suzuki toshiya mpsuzuki at hiroshima-u.ac.jp
Sat Nov 16 03:44:05 PST 2013


Here is revised patch.
The code issuing error messages are harmonized to the surrounding code,
so there are inconsistency (some use error(), other uses fprintf()).
If further work (or better wording) is needed, I will do.
Please comment.

Regards,
mpsuzuki

suzuki toshiya wrote:
> Albert Astals Cid wrote:
>>> If endDocument() is invoked without beginDocument(), uninitialized
>>> surface and output_file are referred, therefore, SEGV is caused.
>>>
>>> The easiest fix would be NULL-initialization (not needed in C++?) of
>>> surface & output_file, and checking NULL before referring them in
>>> endDocument(). Patch is attached.
>> I'd prefer an if check for lastPage < firstPage that tells the user to not 
>> give the program bad parameters. Can you work on that?
> 
> OK, I will do so. Although SEGV does not occur, other utilities
> (e.g. pdftotext, pdftoppm, pdftops etc) do not check such. I will
> make a patchset for all pdftoXXX utilities.
> 
>> Cheers.
>>   Albert
>>
>>> Regards,
>>> mpsuzuki
> 
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler

-------------- next part --------------
A non-text attachment was scrubbed...
Name: poppler_CheckPageRangeInUtils.diff
Type: text/x-patch
Size: 5269 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20131116/5ca08e3f/attachment.bin>


More information about the poppler mailing list