Bastian Blank wrote: > On Tue, Jan 26, 2010 at 01:48:34PM -0600, Jonathan Nieder wrote: > > severity 563882 critical > > Please explain. git is neither unrelated to glibc nor does this cause > serious data loss.
My mistake, sorry about that. > The test program does not properly show what is going on. > > The following program shows the cause: > > | #include <sys/stat.h> > | #include <sys/mman.h> > | #include <fcntl.h> > | > | int main(int argc, const char * const argv[]) > | { > | struct stat st; > | lstat(argv[1], &st); > | > | int fd = open(argv[1], O_RDONLY); > | void *data = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); > | void *t = memchr(data, 0, st.st_size); > | printf("ptr: %p, ret: %p, len: 0x%zx\n", data, t, st.st_size); > | return 0; > | } > > Example output: > | % ./test /etc/passwd > | ptr: 0x2000000000050000, ret: 0x200000000005040e, len: 0x40e > > The found location is already after the buffer. memchr is AFAIK expanded > by gcc. Thanks for the clear test case. Given gcc -S output, I would gladly look it over. Regards, Jonathan -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org