소스 검색

don't crash on malformed CAPABILITY responses

amends 95a83c822.

this problem was found by Lukas Braun <koomi@moshbit.net> using a
fuzzer.
Oswald Buddenhagen 4 년 전
부모
커밋
a86e6f8c7c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/drv_imap.c

+ 1 - 1
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;
 		}