complain about malformed item names in FETCH responses

This commit is contained in:
Oswald Buddenhagen 2019-11-22 17:49:04 +01:00
parent 47b477b3fb
commit 8acf56b311

View File

@ -1056,8 +1056,10 @@ parse_fetch_rsp( imap_store_t *ctx, list_t *list, char *s ATTR_UNUSED )
} }
for (tmp = list->child; tmp; tmp = tmp->next) { for (tmp = list->child; tmp; tmp = tmp->next) {
if (!is_atom( tmp )) if (!is_atom( tmp )) {
continue; error( "IMAP error: bogus item name in FETCH response\n" );
goto ffail;
}
if (!strcmp( "UID", tmp->val )) { if (!strcmp( "UID", tmp->val )) {
tmp = tmp->next; tmp = tmp->next;
if (!is_atom( tmp ) || (uid = strtoul( tmp->val, &ep, 10 ), *ep)) { if (!is_atom( tmp ) || (uid = strtoul( tmp->val, &ep, 10 ), *ep)) {