don't crash on truncated LIST response
found by coverity.
This commit is contained in:
parent
0dfbf6f6fb
commit
fd872a7ff7
|
@ -1040,8 +1040,9 @@ parse_list_rsp( imap_store_t *ctx, list_t *list, char *cmd )
|
||||||
list_t *lp;
|
list_t *lp;
|
||||||
|
|
||||||
if (!is_list( list )) {
|
if (!is_list( list )) {
|
||||||
error( "IMAP error: malformed LIST response\n" );
|
|
||||||
free_list( list );
|
free_list( list );
|
||||||
|
bad_list:
|
||||||
|
error( "IMAP error: malformed LIST response\n" );
|
||||||
return LIST_BAD;
|
return LIST_BAD;
|
||||||
}
|
}
|
||||||
for (lp = list->child; lp; lp = lp->next)
|
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;
|
return LIST_OK;
|
||||||
}
|
}
|
||||||
free_list( list );
|
free_list( list );
|
||||||
arg = next_arg( &cmd );
|
if (!(arg = next_arg( &cmd )))
|
||||||
|
goto bad_list;
|
||||||
if (!ctx->delimiter)
|
if (!ctx->delimiter)
|
||||||
ctx->delimiter = nfstrdup( arg );
|
ctx->delimiter = nfstrdup( arg );
|
||||||
return parse_list( ctx, cmd, parse_list_rsp_p2 );
|
return parse_list( ctx, cmd, parse_list_rsp_p2 );
|
||||||
|
|
Loading…
Reference in New Issue
Block a user