Bug 148236 - xorg-x11-6.9.0-9: 2 * array subscript out of range
Summary: xorg-x11-6.9.0-9: 2 * 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
: P2 - High : Normal
Target Milestone: ---
Assignee: Stefan Dirsch
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-04 18:01 UTC by David Binderman
Modified: 2006-02-06 21:18 UTC (History)
1 user (show)

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-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.