commit a86e6f8c7c9a3aebb894dc047545c8902e850e71
parent d8feb67dae1971b08696d529d9ada6bf6fae6faa
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Wed, 14 Apr 2021 16:52:31 +0200
don't crash on malformed CAPABILITY responses
amends 95a83c822.
this problem was found by Lukas Braun <koomi@moshbit.net> using a
fuzzer.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
@@ -1273,7 +1273,7 @@ parse_response_code( imap_store_t *ctx, imap_cmd_t *cmd, char *s )
return RESP_CANCEL;
}
} else if (!strcmp( "CAPABILITY", arg )) {
- if (!(p = strchr( s, ']' ))) {
+ if (!s || !(p = strchr( s, ']' ))) {
error( "IMAP error: malformed CAPABILITY status\n" );
return RESP_CANCEL;
}