mirror of
https://github.com/moparisthebest/curl
synced 2024-12-23 08:38:49 -05:00
ugha, prevent a buffer overflow and allow very long strings in the generated
libcurl source...
This commit is contained in:
parent
dbdb7fa55a
commit
1c0224be42
11
src/main.c
11
src/main.c
@ -3212,7 +3212,7 @@ CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
|||||||
{
|
{
|
||||||
va_list arg;
|
va_list arg;
|
||||||
CURLcode ret;
|
CURLcode ret;
|
||||||
char buffer[128];
|
char *bufp;
|
||||||
char value[256];
|
char value[256];
|
||||||
bool remark=FALSE;
|
bool remark=FALSE;
|
||||||
|
|
||||||
@ -3249,13 +3249,12 @@ CURLcode _my_setopt(CURL *curl, const char *name, CURLoption tag, ...)
|
|||||||
ret = curl_easy_setopt(curl, tag, oval);
|
ret = curl_easy_setopt(curl, tag, oval);
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(buffer, "%scurl_easy_setopt(hnd, %s, %s);%s",
|
bufp = curl_maprintf("%scurl_easy_setopt(hnd, %s, %s);%s",
|
||||||
remark?"/* ":"",
|
remark?"/* ":"", name, value,
|
||||||
name, value,
|
|
||||||
remark?" [REMARK] */":"");
|
remark?" [REMARK] */":"");
|
||||||
|
|
||||||
easycode = curl_slist_append(easycode, buffer);
|
easycode = curl_slist_append(easycode, bufp);
|
||||||
|
curl_free(bufp);
|
||||||
va_end(arg);
|
va_end(arg);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user