|
From: Jack A. <ef...@gm...> - 2007-04-09 23:23:26
|
hi,
i (rather embarrasingly) posted this program as a gcc bug:
main(c,v)char**v;
{int i=1,*z,_a[30];
while(i<c)
{char*s=v[i++],c=s[1];
_a[c]=1;z=malloc(2);
}
}
i had run valgrind over it, so i thought i had checked everything, but
valgrind didn't pick up the error where _a[c] is out of bounds.
should valgrind pick this up?
thanks,
jack
PS. if you want to run it to reproduce the bug, run it with an
argument of, say, aa
|
|
From: Nicholas N. <nj...@cs...> - 2007-04-10 01:33:45
|
On Tue, 10 Apr 2007, Jack Andrews wrote:
> main(c,v)char**v;
> {int i=1,*z,_a[30];
> while(i<c)
> {char*s=v[i++],c=s[1];
> _a[c]=1;z=malloc(2);
> }
> }
>
> i had run valgrind over it, so i thought i had checked everything, but
> valgrind didn't pick up the error where _a[c] is out of bounds.
>
> should valgrind pick this up?
http://www.valgrind.org/docs/manual/faq.html#faq.overruns
|