cURL / Mailing Lists / curl-library / Single Mail


curl_easy_escape() and curl_easy_unescape() length arguments data types

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


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

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

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

Received on 2008-01-14