1
0
mirror of https://github.com/moparisthebest/curl synced 2025-03-01 01:41:50 -05:00

imap: Fixed escaping of mailbox names

Used imap_atom() to escape mailbox names in imap_select().
This commit is contained in:
Jiri Hruska 2013-02-12 14:47:37 +01:00 committed by Steve Holme
parent fcf02cbb75
commit 4cfc7f951c

View File

@ -1089,9 +1089,15 @@ static CURLcode imap_select(struct connectdata *conn)
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct IMAP *imap = data->state.proto.imap;
char *mailbox;
result = imap_sendf(conn, "SELECT %s",
imap->mailbox ? imap->mailbox : "");
mailbox = imap_atom(imap->mailbox ? imap->mailbox : "");
if(!mailbox)
result = CURLE_OUT_OF_MEMORY;
else
result = imap_sendf(conn, "SELECT %s", mailbox);
Curl_safefree(mailbox);
if(result)
return result;