cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURL_DOES_CONVERSIONS overwriting const data

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 27 Aug 2008 20:18:30 -0700

There are a number of places in the code where Curl_client_write() is
called with a string literal as an argument, e.g.

Curl_client_write(conn, CLIENTWRITE_BOTH, (char *)"Accept-ranges: bytes\r\n", 0)

Note the suspicious (char *) cast in there. If CURL_DOES_CONVERSIONS is
defined, then that string is passed to Curl_convert_from_network and is
converted IN PLACE to local host encoding (EBCDIC most likely). Problem is,
string literals are read only on many platforms and such a conversion will
cause a crash. Why doesn't this on TPF (presumably, the only platform to
use this right now)? Are strings there writable? This should be fixed to
generalize it to more platforms unless I'm missing something.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-08-28