|
From: Jim A. <am...@ly...> - 2004-04-20 15:30:14
|
Hi , I'm new to valgrind.
My setup :
Redhat 9
gcc -v
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/specs
Configured with: ./configure
Thread model: posix
gcc version 3.2.2
Valgrind version valgrind-2.0.0
The code :
outfile = (char *)malloc(100);
(void) strncpy (outfile, infile_backup,len);
jfif_name = (char *) malloc(100);
Line 72: (void) strcpy(jfif_name, outfile );
The errors:
==16656== 1 errors in context 1 of 2:
==16656== Conditional jump or move depends on uninitialised value(s)
==16656== at 0x40022F2C: strlen (mac_replace_strmem.c:164)
==16656== by 0x4048F00D: _IO_vfprintf_internal (in /lib/libc-2.3.2.so)
==16656== by 0x404A9F6B: _IO_vsprintf_internal (in /lib/libc-2.3.2.so)
==16656== by 0x404973CC: __GI_sprintf (in /lib/libc-2.3.2.so)
==16656==
==16656== 1 errors in context 2 of 2:
==16656== Conditional jump or move depends on uninitialised value(s)
==16656== at 0x40022F55: strcpy (mac_replace_strmem.c:173)
==16656== by 0x804B311: hdfconverter (hdfconverter.c:72)
==16656== by 0x804E4EF: Process8BitImages (sendbrowse.c:1436)
==16656== by 0x804C612: main (sendbrowse.c:343)
==16656== IN SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
I've printed out outfile so there is data there.
The data is way less than 100 characters.
Not sure what I'm missing.
Thx in advance,
Jim
|