Bug 24721 - Potential negative page index
Summary: Potential negative page index
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium major
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-25 06:04 UTC by Ilya Gorenbein
Modified: 2009-10-25 13:58 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Ilya Gorenbein 2009-10-25 06:04:46 UTC
Hello,

Im using version 0.12.0. At poppler/PageLabelInfo.cc PageLabelInfo constructor we have:

         interval->length = next->base - interval->base;  (line 206)

         and

         interval->length = numPages - interval->base; (line 206)

The result of those operations could potentially cause interval->length to be negative. Following this, value to which index parameter points at 
GBool PageLabelInfo::labelToIndex(GooString *label, int *index) function 
could be negative. The could affect the rendering flow as it is used in  glib/poppler-document.cc.

Regards,
Ilya Gorenbein
Comment 1 Albert Astals Cid 2009-10-25 13:58:43 UTC
Fixed by adding 

if (interval->length < 0) interval->length = 0;

That should be enough for the moment.

Thanks for the report.

By the way i just realized that the pagelabelinfo implementation has some problems, mail me in private if you have time to code a small patch for it.


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.