cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [EXAMPLE] Bug in getinmemory.c

From: Dan Fandrich <dan_at_coneharvesters.com>
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 <dan_at_coneharvesters.com>:
> > "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: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-10