Bug 115191 - subscript out of range & 2 * used before set
Summary: subscript out of range & 2 * used before set
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: netpbm
Version: 1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: Ben Levenson
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-02-08 10:49 UTC by d.binderman
Modified: 2015-03-05 01:13 UTC (History)
1 user (show)

(edit)
Clone Of:
(edit)
Last Closed: 2004-02-09 16:03:55 UTC


Attachments (Terms of Use)

Description d.binderman 2004-02-08 10:49:51 UTC
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 16:03:55 UTC
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.