Bug 359899

Summary: array indices off by 1 in evdev input driver
Product: [openSUSE] openSUSE 11.0 Reporter: Marcus Meissner <meissner>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Alpha 2   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 240922    
Attachments: evdev-max-fixes.patch

Description Marcus Meissner 2008-02-08 12:52:36 UTC
Created attachment 193841 [details]
evdev-max-fixes.patch

gcc 4.3 warned:
evdev_axes.c: In function 'EvdevAxesRealSyn':
evdev_axes.c:170: warning: array subscript is above array bounds
evdev_axes.c:189: warning: array subscript is above array bounds

It uses axes[0x3f], which should be valid.

reviewing the code shows that XXX_MAX values are used a arraysizes, however
the arraysize should be XXX_MAX+1.

I fixed the array sizes and various checks to match reality better.
Comment 1 Stefan Dirsch 2008-02-08 16:39:49 UTC
Thanks. xorg-x11-driver-input submitted for STABLE.