Bug 155809

Summary: marsnwe-0.99.pl20-590: array subscript out of range
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: E-mail List <bnc-team-screening>
Status: RESOLVED DUPLICATE QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2006-03-07 18:16:10 UTC
I just tried to compile package marsnwe-0.99.pl20-590 with the Intel C compiler.

It said

../nwbind.c(1904): warning #175: subscript out of range

The source code is

  struct XDATA {
    uint8 count_handles[4];
    uint8 handles[4];
  } *xdata = (struct XDATA*) data;
  int open_files = GET_BE32(xdata->count_handles);
  int handle0    = open_files < 1 ? 0 : GET_BE32(xdata->handles);
  int handle1    = open_files < 2 ? 0 : GET_BE32(xdata->handles+4);

I agree with the compiler. There are only four handles in xdata, so asking
for xdata->handles+4 is off the end of the array. 

Suggest code rework.
Comment 1 David Binderman 2006-05-20 07:38:30 UTC
Still broken in the later version that ships in Suse Linux 10.1
Comment 2 David Binderman 2006-11-04 11:06:43 UTC
(In reply to comment #1)
> Still broken in the later version that ships in Suse Linux 10.1

Still broken in Suse Linux 10.2 beta 1

Comment 3 Stefan Dirsch 2007-01-16 22:32:49 UTC
Feel free to close as duplicate of Bug #235591.
Comment 5 Cyril Hrubis 2007-10-11 16:00:54 UTC

*** This bug has been marked as a duplicate of bug 235591 ***