be somewhat stricter about the LIST response syntax

the first token *must* be a list.
This commit is contained in:
Oswald Buddenhagen 2013-07-27 15:35:42 +02:00
parent a0dc37339e
commit 6dfccb76a5

View File

@ -887,11 +887,11 @@ parse_list_rsp( imap_store_t *ctx, list_t *list, char *cmd )
char *arg; char *arg;
list_t *lp; list_t *lp;
if (!list) { if (!is_list( list )) {
error( "IMAP error: malformed LIST response\n" ); error( "IMAP error: malformed LIST response\n" );
free_list( list );
return LIST_BAD; return LIST_BAD;
} }
if (list->val == LIST)
for (lp = list->child; lp; lp = lp->next) for (lp = list->child; lp; lp = lp->next)
if (is_atom( lp ) && !strcasecmp( lp->val, "\\NoSelect" )) { if (is_atom( lp ) && !strcasecmp( lp->val, "\\NoSelect" )) {
free_list( list ); free_list( list );