Bug 144848 - gcc doesn't detect uninitialized read from array
Summary: gcc doesn't detect uninitialized read from array
Status: RESOLVED WONTFIX
Alias: None
Product: SUSE Linux 10.1
Classification: openSUSE
Component: Development (show other bugs)
Version: Beta 1
Hardware: Other Other
: P4 - Low : Enhancement (vote)
Target Milestone: ---
Assignee: Michael Matz
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-23 16:31 UTC by Marian Jancar
Modified: 2008-04-28 15:21 UTC (History)
0 users

See Also:
Found By: Development
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 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.