Browse Source

don't crash on truncated LIST response

found by coverity.
1.1
Oswald Buddenhagen 11 years ago
parent
commit
fd872a7ff7
  1. 6
      src/drv_imap.c

6
src/drv_imap.c

@ -1040,8 +1040,9 @@ parse_list_rsp( imap_store_t *ctx, list_t *list, char *cmd )
list_t *lp;
if (!is_list( list )) {
error( "IMAP error: malformed LIST response\n" );
free_list( list );
bad_list:
error( "IMAP error: malformed LIST response\n" );
return LIST_BAD;
}
for (lp = list->child; lp; lp = lp->next)
@ -1050,7 +1051,8 @@ parse_list_rsp( imap_store_t *ctx, list_t *list, char *cmd )
return LIST_OK;
}
free_list( list );
arg = next_arg( &cmd );
if (!(arg = next_arg( &cmd )))
goto bad_list;
if (!ctx->delimiter)
ctx->delimiter = nfstrdup( arg );
return parse_list( ctx, cmd, parse_list_rsp_p2 );

Loading…
Cancel
Save