Thanks!  I see now that the example was not working because fscanf had
simply continued onwards and wasn't finding the information correctly
formatted and hence did not set the value.  However, if you correct that
mistake the original problem still exists (file attached).

Furthermore, when compiling with the " -Wall -std=c99" options in gcc
4.1.2 (Ubuntu 4.1.2-0ubuntu4) it says:

fscanfbug.c:17: warning: format ‘%d’ expects type ‘int *’, but argument
3 has type ‘int8_t *’

So it appears that the PRId8 macro is being incorrectly defined as "d"
on my machine when it should in fact be "hhd", leading to the byte
overwrites I mentioned initially. Finally, adding the extra two h's
corrects the problem.

Maybe there is a bug in inttypes for AMD Athlon 64 cpus?


** Attachment added: "fscanfbug.c"
   http://librarian.launchpad.net/7479571/fscanfbug.c

-- 
fscanf out of bounds write
https://bugs.launchpad.net/bugs/110917
You received this bug notification because you are a member of Ubuntu
Bugs, which is the bug contact for Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to