From: Jiri Hruska Date: Tue, 12 Feb 2013 13:47:37 +0000 (+0100) Subject: imap: Fixed escaping of mailbox names X-Git-Tag: curl-7_30_0~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cfc7f951c7cbd596849a1b942bc676132f97e15;p=thirdparty%2Fcurl.git imap: Fixed escaping of mailbox names Used imap_atom() to escape mailbox names in imap_select(). --- diff --git a/lib/imap.c b/lib/imap.c index 1c4f1fa8cd..dce9f3016e 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -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;