Bug 80818 - bad source code
Summary: bad source code
Keywords:
Status: CLOSED DUPLICATE of bug 57350
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: pump
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eido Inoue
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-31 17:57 UTC by d.binderman
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-21 18:50:49 UTC
Embargoed:


Attachments (Terms of Use)

Description d.binderman 2002-12-31 17:57:04 UTC
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 pump-0.8.12-3 from Redhat 8.0

Here are some of the messages the compiler produces

cc: Info: pump.c, line 600: 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.

./pump.c.old ./pump.c
*** ./pump.c.old	Tue Dec 24 21:33:57 2002
--- ./pump.c	Tue Dec 24 21:36:21 2002
***************
*** 597,603 ****
  		    if (intf[i].set & PUMP_NETINFO_HAS_HOSTNAME)
  			strncpy(cmd.u.status.hostname,
  			    intf->hostname, sizeof(cmd.u.status.hostname));
! 		    cmd.u.status.hostname[sizeof(cmd.u.status.hostname)] = '\0';
  
  		    if (intf[i].set & PUMP_NETINFO_HAS_DOMAIN)
  			strncpy(cmd.u.status.domain,
--- 597,603 ----
  		    if (intf[i].set & PUMP_NETINFO_HAS_HOSTNAME)
  			strncpy(cmd.u.status.hostname,
  			    intf->hostname, sizeof(cmd.u.status.hostname));
! 		    cmd.u.status.hostname[sizeof(cmd.u.status.hostname) - 1] = '\0';
  
  		    if (intf[i].set & PUMP_NETINFO_HAS_DOMAIN)
  			strncpy(cmd.u.status.domain,


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


How reproducible:
Always

Steps to Reproduce:
1. compile with any C compiler that checks array indexes, for example Compaq.
2.
3.
    

Additional info:

Comment 1 Eido Inoue 2003-03-11 23:06:33 UTC

*** This bug has been marked as a duplicate of 57350 ***

Comment 2 Red Hat Bugzilla 2006-02-21 18:50:49 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.


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