|
From: Nicholas N. <nj...@cs...> - 2005-08-12 13:20:57
|
On Fri, 12 Aug 2005, Matthew J Fletcher wrote:
>> But obviously the space after the staticly allocated buffer is defined and
>> valid, so VG has no way to regard this as error.
>
> "gzip,deflate" is a unique symbol to a constant string in the elf, the pointer
> Deflate points (after the strstr) to an address 6 bytes into that symbol.
> When you add 8 to the address of the Deflate pointer the address reached is
> beyond the end of the symbol and will either point into the next constant
> string symbol or off the end of the section.
Yes, but from Memcheck's point of view, that memory is (a) addressable and
(b) initialised, so it does not complain. From the FAQ.txt:
5.2. Why doesn't Memcheck find the array overruns in this program?
int static[5];
int main(void)
{
int stack[5];
static[5] = 0;
stack [5] = 0;
return 0;
}
Unfortunately, Memcheck doesn't do bounds checking on static or stack
arrays. We'd like to, but it's just not possible to do in a reasonable
way that fits with how Memcheck works. Sorry.
N
|