Bug 155809 - marsnwe-0.99.pl20-590: array subscript out of range
Summary: marsnwe-0.99.pl20-590: array subscript out of range
Status: RESOLVED DUPLICATE of bug 235591
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SuSE Linux 10.1
: P5 - None : Normal
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-07 18:16 UTC by David Binderman
Modified: 2007-10-11 16:00 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-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 ***