mirror of
https://github.com/curl/curl.git
synced 2026-06-27 07:35:37 +03:00
form/mime: field names are not allowed to contain zero-valued bytes.
Also suppress length argument of curl_mime_name() (names are always zero-terminated).
This commit is contained in:
parent
fa9482ab09
commit
ee56fdb691
21 changed files with 94 additions and 102 deletions
|
|
@ -51,17 +51,17 @@ int main(void)
|
|||
|
||||
/* Fill in the file upload field */
|
||||
field = curl_mime_addpart(form);
|
||||
curl_mime_name(field, "sendfile", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(field, "sendfile");
|
||||
curl_mime_filedata(field, "multi-post.c");
|
||||
|
||||
/* Fill in the filename field */
|
||||
field = curl_mime_addpart(form);
|
||||
curl_mime_name(field, "filename", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(field, "filename");
|
||||
curl_mime_data(field, "multi-post.c", CURL_ZERO_TERMINATED);
|
||||
|
||||
/* Fill in the submit field too, even if this is rarely needed */
|
||||
field = curl_mime_addpart(form);
|
||||
curl_mime_name(field, "submit", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(field, "submit");
|
||||
curl_mime_data(field, "send", CURL_ZERO_TERMINATED);
|
||||
|
||||
/* initialize custom header list (stating that Expect: 100-continue is not
|
||||
|
|
|
|||
|
|
@ -61,17 +61,17 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Fill in the file upload field */
|
||||
field = curl_mime_addpart(form);
|
||||
curl_mime_name(field, "sendfile", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(field, "sendfile");
|
||||
curl_mime_filedata(field, "postit2.c");
|
||||
|
||||
/* Fill in the filename field */
|
||||
field = curl_mime_addpart(form);
|
||||
curl_mime_name(field, "filename", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(field, "filename");
|
||||
curl_mime_data(field, "postit2.c", CURL_ZERO_TERMINATED);
|
||||
|
||||
/* Fill in the submit field too, even if this is rarely needed */
|
||||
field = curl_mime_addpart(form);
|
||||
curl_mime_name(field, "submit", CURL_ZERO_TERMINATED);
|
||||
curl_mime_name(field, "submit");
|
||||
curl_mime_data(field, "send", CURL_ZERO_TERMINATED);
|
||||
|
||||
/* initialize custom header list (stating that Expect: 100-continue is not
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue