cURL / Mailing Lists / curl-library / Single Mail


Re: [EXAMPLE] Bug in getinmemory.c

From: Dan Fandrich <>
Date: Tue, 10 May 2011 13:18:47 -0700

On Tue, May 10, 2011 at 10:11:02PM +0200, Martin Möller wrote:
> Am 10.05.11 21:55 schrieb "Dan Fandrich" unter <>:
> > "The contents of the memory are unchanged up to the lesser of the new and
> > old sizes."
> "If the new size is larger, the contents of the newly allocated portion of
> the memory are undefined."

The "newly allocated" portion refers to the part that lies beyond the
end of the first memory block. If the original block size is 10 bytes
and the new one is 20, then the first 10 bytes of the new block (the lesser
of 10 and 20) will be the same as the old one, and bytes 11-20 (the newly
allocated portion) are undefined.

>>> Dan
List admin:
Received on 2011-05-10