Bug 80764 - broken source code
broken source code
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: netpbm (Show other bugs)
8.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-12-30 18:53 EST by d.binderman
Modified: 2015-03-04 20:11 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-06 08:38:09 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 2002-12-30 18:53:19 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.6 [en-gb]C-CCK-MCD NetscapeOnline.co.uk  (Win98; I)

Description of problem:

Hello there,

I have just tried to compile netpbm-9.24-6 from Redhat 8.0

Here are some of the messages the compiler produces

cc: Info: /usr/src/redhat/BUILD/netpbm-9.24/ppm/ppmtoxpm.c, line 136: In this statement, an array is being accessed outside the bounds specified 
for the array type. (subscrbounds)

Here is an untested patch to shut up the compiler.

./ppm/ppmtoxpm.c.old ./ppm/ppmtoxpm.c
*** ./ppm/ppmtoxpm.c.old	Thu Dec 19 22:07:38 2002
--- ./ppm/ppmtoxpm.c	Thu Dec 19 22:08:53 2002
***************
*** 132,139 ****
          static char name[80+1];
          char *cp;
  
!         strncpy(name, cmdline_p->input_filespec, sizeof(name));
!         name[sizeof(name)] = '\0';
          cp = strchr(name, '.');
          if (cp)
              *cp = '\0';     /* remove extension */
--- 132,139 ----
          static char name[80+1];
          char *cp;
  
!         strncpy(name, cmdline_p->input_filespec, sizeof(name) - 1);
!         name[sizeof(name) - 1] = '\0';
          cp = strchr(name, '.');
          if (cp)
              *cp = '\0';     /* remove extension */


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


How reproducible:
Always

Steps to Reproduce:
1. compile with any C compiler that checks array indices, such as Compaq C
2.
3.
    

Additional info:
Comment 1 Phil Knirsch 2004-02-06 08:38:09 EST
Has been fixed in latest rawhide version.

Read ya, Phil

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