Trouble is, it's undocumented as to how to free the resulting string. Do I call free on it? I'd use asprintf, but I'm afraid to suggest that here as it may not be portable.

On Jul 5, 2007, at 10:45 AM, Hrvoje Niksic wrote:

"Tony Lewis" <[EMAIL PROTECTED]> writes:

There is a buffer overflow in the following line of the proposed code:

     sprintf(filecopy, "\"%.2047s\"", file);

Wget has an `aprintf' utility function that allocates the result on
the heap.  Avoids both buffer overruns and arbitrary limits on file
name length.

--
Rich "wealthychef" Cook
925-784-3077
--
it takes many small steps to climb a mountain, but the view gets better all the time.


Reply via email to