cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Potential integer overflow with write callback

From: <richardcavell_at_mail.com>
Date: Sun, 27 Mar 2011 07:21:09 -0400

> > size_t is guaranteed only to be at least 16 bits according to the
> > standard
>
> Have you ever seen libcurl run on a system with size_t being 16 bit?
> It would seem unlikely that the callback will be the point of
failure.
> Presumably malloc will overflow (somewhere) long before that if
you're trying
> to transfer 64K chunks on a 16 bit machine.

I have written a Wikipedia bot that is highly portable. It relies on
libcurl, so I suppose it's only as portable as libcurl is. Yet, I have
had the idea of porting it to an embedded architecture. It's not
inconceivable that it could run on a 16-bit size_t machine.

Though, as you hint at, if the bot wanted to do any serious editing, it
would need to be able to store a whole Wikipedia page in RAM (up to
2000 kbytes), or be able to stream it as a file.

Richard

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-27