Bug 146013

Summary: 6 * array subscript out of range
Product: [Fedora] Fedora Reporter: David Binderman <dcb314>
Component: quaggaAssignee: Jay Fenlason <fenlason>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: jfeeney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.98.5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-18 15:30:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Binderman 2005-01-24 18:39:07 UTC
Description of problem:

I just tried to compile package quagga-0.98.0-2 from 
Redhat Fedora development tree.

The compiler said

1.

ospf6_asbr.c(456): warning #175: subscript out of range

The source code is

      zlog_debug ("Redistribute %s (%s)", pbuf, ZROUTE_NAME (type));

but

#define ZROUTE_NAME(x)                                     \
  (0 < (x) && (x) < ZEBRA_ROUTE_MAX ? zroute_name[(x)] :   \
   zroute_name[ZEBRA_ROUTE_MAX])

and

const char *zroute_name[] =
{ "system", "kernel", "connected", "static",
  "rip", "ripng", "ospf", "ospf6", "isis", "bgp", "unknown" };

and

../BUILD/quagga-0.98.0/lib/zebra.h:#define ZEBRA_ROUTE_MAX           
      11

Suggest avoid access zroute_name[ 11], since it does not exist.

2.

ospf6_asbr.c(759): warning #175: subscript out of range
ospf6_asbr.c(762): warning #175: subscript out of range
ospf6_asbr.c(798): warning #175: subscript out of range
ospf6_asbr.c(803): warning #175: subscript out of range
ospf6_asbr.c(1208): warning #175: subscript out of range

Duplicates.



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


How reproducible:


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


Expected results:


Additional info:

Comment 1 Jay Fenlason 2005-10-18 15:30:00 UTC
These paticular warnings are gone from 0.98.5, although plenty of others 
remain. 

Comment 2 David Binderman 2005-10-18 20:13:02 UTC
>These paticular warnings are gone from 0.98.5

Sure ?

Those warning messages are from the Intel compiler.

Are you telling us you tried the Intel compiler or are you
telling us that you visually inspected the code and it
won't make those warnings anymore ?

GNU C [ in any released version ] doesn't warn about array index
out of range.