strange problem with self-compiled software on FC 5 T2...

Patrick von der Hagen patrick at wudika.de
Wed Feb 8 05:43:58 UTC 2006


Ulrich Drepper wrote:
> Patrick von der Hagen wrote:
>> Now, whom should I contact? glibc, gnu-c or gnu-c++?
> 
> Nobody but the person who wrote that code.  You pass a pointer to a
> 'char' variable for the %s format element.  Even *if* you only read one
> character the terminating NUL byte will overwrite the next byte.  That's
> likely your variable 'j'.
It's really amazing how many people missed that one and that several 
compilers (e.g. gnu-gcc/g++ 3.5) produced binaries that worked 
flawlessly. But you are right, "c" was placed next to "j" in memory, so 
j has been damaged by invocing fscanf. Fixing the format-string solved 
my problems.

Sorry for all that noise.
-- 
CU,
    Patrick.




More information about the fedora-test-list mailing list