From a86e6f8c7c9a3aebb894dc047545c8902e850e71 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 14 Apr 2021 16:52:31 +0200 Subject: [PATCH] don't crash on malformed CAPABILITY responses amends 95a83c822. this problem was found by Lukas Braun using a fuzzer. --- src/drv_imap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index d4fcc1f..edae95c 100644 --- 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; }