Bug 146013 - 6 * array subscript out of range
6 * array subscript out of range
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: quagga (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-01-24 13:39 EST by David Binderman
Modified: 2014-08-31 19:27 EDT (History)
1 user (show)

See Also:
Fixed In Version: 0.98.5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-18 11:30:00 EDT
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 David Binderman 2005-01-24 13:39:07 EST
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 11:30:00 EDT
These paticular warnings are gone from 0.98.5, although plenty of others 
remain. 
Comment 2 David Binderman 2005-10-18 16:13:02 EDT
>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.

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