Bug 144848

Summary: gcc doesn't detect uninitialized read from array
Product: [openSUSE] SUSE Linux 10.1 Reporter: Marian Jancar <mjancar>
Component: DevelopmentAssignee: Michael Matz <matz>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Enhancement    
Priority: P4 - Low    
Version: Beta 1   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Development Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Marian Jancar 2006-01-23 16:31:39 UTC
michael.matz@novell.com wrote:

Short testprogram:
---------------------------
extern unsigned long slen(const unsigned char *);
int f (unsigned char *input) {
        unsigned char           buffer[100];
        unsigned char           *pos;

        pos = input;

        if (*pos == '"') pos++;
        return buffer[slen(pos)] == 'a';
}
--------------------------------------

This doesn't warn.  Replacing the slen(pos) call with a constant like
2 does warn that buffer[2] isn't initialized.  So this is a possible
enhancement for GCC.
Comment 1 Richard Biener 2006-04-11 15:57:30 UTC
Forwarded to http://gcc.gnu.org/PR27120
Comment 2 Andreas Jaeger 2008-04-28 15:21:00 UTC
We will take this from upstream once it'S fixed for future releases.

WONTFIX for 10.1.