Bug 76478 - [gfile.cc:495]: (style) Array index 'i' is used before limits check.
Summary: [gfile.cc:495]: (style) Array index 'i' is used before limits check.
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-22 12:07 UTC by dcb314
Modified: 2014-03-22 16:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description dcb314 2014-03-22 12:07:51 UTC
Source code is

    for (i = 0; mode[i] && i < sizeof(mode) - 1; ++i) {

Suggest new code

    for (i = 0; i < sizeof(mode) - 1 && mode[i]; ++i) {
Comment 1 Albert Astals Cid 2014-03-22 16:36:18 UTC
I think the previous condition was correct anyway because of the extra -1 in the i check but it really makes more sense to have the i check first

Thanks for the report.


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.