mirror of
https://github.com/curl/curl.git
synced 2026-08-25 06:03:32 +03:00
mime: explicitly rewind subparts at attachment time.
Subparts may have been previously used as a top-level mime structure and thus not rewound. New test 695 checks the proper functioning in these particular conditions. Reported-by: Qriist on github Fixes #15842 Closes #15911
This commit is contained in:
parent
e602f7f119
commit
1b3f00f794
5 changed files with 205 additions and 2 deletions
|
|
@ -1561,6 +1561,14 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part,
|
|||
}
|
||||
}
|
||||
|
||||
/* If subparts have already been used as a top-level MIMEPOST,
|
||||
they might not be positioned at start. Rewind them now, as
|
||||
a future check while rewinding the parent may cause this
|
||||
content to be skipped. */
|
||||
if(mime_subparts_seek(subparts, (curl_off_t) 0, SEEK_SET) !=
|
||||
CURL_SEEKFUNC_OK)
|
||||
return CURLE_SEND_FAIL_REWIND;
|
||||
|
||||
subparts->parent = part;
|
||||
/* Subparts are processed internally: no read callback. */
|
||||
part->seekfunc = mime_subparts_seek;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue