Bug 240893

Summary: xorg-x11-doc-7.2-14: array subscript is above array bounds
Product: [openSUSE] openSUSE 10.3 Reporter: David Binderman <dcb314>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED DUPLICATE QA Contact: Stefan Dirsch <sndirsch>
Severity: Normal    
Priority: P5 - None    
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 2007-01-31 21:21:56 UTC
I just tried to compile package xorg-x11-doc-7.2-14
with the new GNU compiler version 4.3 snapshot 20070126

The compiler said

imLcPrs.c:600: warning: array subscript is above array bounds

The source code is

    if (l == LOCAL_UTF8_BUFSIZE - 1) {
        local_wc_buf[l] = '\0';

but

	wchar_t local_wc_buf[LOCAL_WC_BUFSIZE]

#define LOCAL_WC_BUFSIZE 128
#define LOCAL_UTF8_BUFSIZE 256

so the program is trying to index 255 into an array of size 128.

Suggest code rework.
Comment 1 Stefan Dirsch 2007-01-31 22:13:41 UTC

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