Bug 144599 - iprutils-2.1.2-2: 6 * array subscript out of range
Summary: iprutils-2.1.2-2: 6 * array subscript out of range
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SUSE Other
: P5 - None : Minor
Target Milestone: SUSE Linux 10.1
Assignee: Olaf Hering
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-21 12:44 UTC by David Binderman
Modified: 2006-07-19 09:50 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2006-01-21 12:44:48 UTC
I just tried to compile package iprutils-2.1.2-2 with the Intel C compiler.

It said

1.

iprconfig.c(10563): warning #175: subscript out of range

The source code is

        for_each_dev_rcd(dev_rcd, &qac_data) {

I'm not entirely sure what's going on with this line of code, but in my
opinion, the macro

#define __for_each_qac_entry(rcd, qac, type) \
      for (rcd = (type *)(qac)->data; \
           ((unsigned long)rcd) < ((unsigned long)((unsigned long)(qac) + ntohs((qac)->resp_len))) && \
           ((unsigned long)rcd) < ((unsigned long)((qac)->data + sizeof(*(qac)))); \
           rcd = (type *)((unsigned long)rcd + ntohs(((struct ipr_common_record *)rcd)->record_len)))

seems suspicious. Given that the Intel C compiler only complains about array
subscripts when they are certainly out of range, maybe the line

           ((unsigned long)rcd) < ((unsigned long)((qac)->data + sizeof(*(qac)))); 

needs replacing by

           ((unsigned long)rcd) < ((unsigned long)((qac)->data + sizeof((qac)->data))); 

2.

iprconfig.c(3585): warning #175: subscript out of range
iprconfig.c(3805): warning #175: subscript out of range
iprconfig.c(3810): warning #175: subscript out of range

Duplicates.

3.

iprlib.c(3149): warning #175: subscript out of range
iprlib.c(3187): warning #175: subscript out of range

The source code is

	for_each_qac_entry(common_record, qac_data) {
Comment 1 Olaf Hering 2006-01-23 13:06:00 UTC
I have notified Brian King. 
Comment 2 Olaf Hering 2006-07-19 09:50:42 UTC
this was fixed in 2.6.14, 2006/03/14