Bug 115191 - subscript out of range & 2 * used before set
subscript out of range & 2 * used before set
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: netpbm (Show other bugs)
1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-02-08 05:49 EST by d.binderman
Modified: 2015-03-04 20:13 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-02-09 11:03:55 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description d.binderman 2004-02-08 05:49:51 EST
Description of problem:

I just tried to compile package netpbm-9.24-12 from Fedora.

The compiler said

1.

/usr/src/redhat/BUILD/netpbm-9.24/ppm/ppmtoxpm.c(136): warning #175:
subscript out of range

The source code is

        static char name[80+1];
        char *cp;

        strncpy(name, cmdline_p->input_filespec, sizeof(name));
        name[sizeof(name)] = '\0';

Clearly broken code. Maybe

        name[sizeof(name) - 1] = '\0';

would be better ?

2.

/usr/src/redhat/BUILD/netpbm-9.24/pnm/pnmtopng.c(334): remark #592:
variable "mayscale" is used before its value is set

The source code is

        for (y = 0 ; y < rows && mayscale ; y++) {

but the only other previous mention of mayscale is

    int mayscale;

Suggest init mayscale before first use.

3.

/usr/src/redhat/BUILD/netpbm-9.24/pnm/pnmtopng.c(421): remark #592:
variable "mayscale" is used before its value is set

Duplicate.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Phil Knirsch 2004-02-09 11:03:55 EST
All comments relating to latest netpbm-10.19 in rawhide:

1) Already fixed upstream.
2) Already fixed upstream.
3) Already fixed upstream.

So everything has been fixed in the latest netpbm package from rawhide.

Read ya, Phil

Note You need to log in before you can comment on or make changes to this bug.