Bug 148236

Summary: xorg-x11-6.9.0-9: 2 * array subscript out of range
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P2 - High CC: eich
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2006-02-04 18:01:24 UTC
I just tried to compile package xorg-x11-6.9.0-9 with a non standard version
of the GNU C compiler.

It said

1.

arbprogparse.c:3262: warning: array subscript out of range

The source code is

   vp->SrcReg[3].Swizzle = SWIZZLE_NOOP;

I agree with the compiler. Suggest code rework.

2.

xf86Calcomp.c:411: warning: array subscript out of range

The source code is

	y = priv->packet[5] + priv->packet[4]*128 +priv->packet[3]*128*128;

but

#define CALCOMP_PACKET_SIZE    5

so priv->packet[5] does not exist. Suggest code rework.
Comment 1 Stefan Dirsch 2006-02-06 13:11:28 UTC
Indeed. This looks broken. :-(
Comment 2 Stefan Dirsch 2006-02-06 13:34:00 UTC
> arbprogparse.c:3262: warning: array subscript out of range
>
> The source code is
>
>   vp->SrcReg[3].Swizzle = SWIZZLE_NOOP;
>
> I agree with the compiler. Suggest code rework.

This has been fixed in current Mesa CVS (big changes, that I don't want 
to adopt at this point).

> 2.
>
> xf86Calcomp.c:411: warning: array subscript out of range
>
> The source code is
>
>        y = priv->packet[5] + priv->packet[4]*128 +priv->packet[3]*128*128;
>
> but
>
> #define CALCOMP_PACKET_SIZE    5

Not sure how to fix this without completely understanding the driver. Bug probably the define should be

#define CALCOMP_PACKET_SIZE    6

Can anybody confirm this?
                               
Comment 3 Stefan Dirsch 2006-02-06 21:18:17 UTC
I've reported the input driver problem upstream now.

--> https://bugs.freedesktop.org/show_bug.cgi?id=5830

Closing as FIXED therefore.