mirror of
https://github.com/curl/curl.git
synced 2026-04-14 23:51:42 +03:00
imap: reset the UIDVALIDITY state between transfers
uidvalidity_set and mb_uidvalidity_set flags were never reset, leaving a
risk for stale UIDVALIDITY state across transfers and mailbox switches.
Follow-up to fb6a4802d7
Spotted by Codex Security
Closes #20962
This commit is contained in:
parent
ae09e5bf0d
commit
a46816b4cb
1 changed files with 2 additions and 0 deletions
|
|
@ -776,6 +776,7 @@ static CURLcode imap_perform_select(struct Curl_easy *data,
|
|||
|
||||
/* Invalidate old information as we are switching mailboxes */
|
||||
Curl_safefree(imapc->mailbox);
|
||||
imapc->mb_uidvalidity_set = FALSE;
|
||||
|
||||
/* Check we have a mailbox */
|
||||
if(!imap->mailbox) {
|
||||
|
|
@ -1703,6 +1704,7 @@ static void imap_easy_reset(struct IMAP *imap)
|
|||
Curl_safefree(imap->query);
|
||||
Curl_safefree(imap->custom);
|
||||
Curl_safefree(imap->custom_params);
|
||||
imap->uidvalidity_set = FALSE;
|
||||
/* Clear the transfer mode for the next request */
|
||||
imap->transfer = PPTRANSFER_BODY;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue