Bug 144599

Summary: iprutils-2.1.2-2: 6 * array subscript out of range
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Olaf Hering <ohering>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None    
Version: unspecified   
Target Milestone: SUSE Linux 10.1   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

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