|
From: Tom H. <th...@cy...> - 2004-04-20 15:48:32
|
In message <loo...@po...>
Jim Amrhein <am...@ly...> wrote:
> The code :
>
>
> outfile = (char *)malloc(100);
>
> (void) strncpy (outfile, infile_backup,len);
>
> jfif_name = (char *) malloc(100);
>
> Line 72: (void) strcpy(jfif_name, outfile );
If len is more than 100 then this will fail as outfile won't be nul
terminated, and valgrind would be telling the truth.
> I've printed out outfile so there is data there.
> The data is way less than 100 characters.
But is len set correctly?
Tom
--
Tom Hughes (th...@cy...)
Software Engineer, Cyberscience Corporation
http://www.cyberscience.com/
|