Bug 146013 - 6 * array subscript out of range
Summary: 6 * array subscript out of range
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: quagga
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-01-24 18:39 UTC by David Binderman
Modified: 2014-08-31 23:27 UTC (History)
1 user (show)

Fixed In Version: 0.98.5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-18 15:30:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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