cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_easy_escape() and curl_easy_unescape() length arguments data types

From: Yang Tse <yangsita_at_gmail.com>
Date: Mon, 14 Jan 2008 21:29:47 +0100

Hi,

I suppose this potential failure is quite theoretical on 32 and 64bit
platforms. But on others it could happen more easily.

Right now we have int as the data type for the length arguments as:

char *curl_easy_escape(CURL *handle, const char *string, int inlength);
char *curl_easy_unescape(CURL *handle, const char *string, int length,
int *olen);

Right now both functions will misbehave on OSs where sizeof(int) !=
sizeof(ssize_t) when trying to handle an input string with a length
that does not fit in an 'int' even when the length argument is not
specified.

Probably all three lengths should be changed to 'size_t'.

Before release, after release, or forget about it ;-) ?

-- 
-=[Yang]=-
Received on 2008-01-14