From 124518ae5fba9e352a9cf8a8d7c1a8160475d10b Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Tue, 14 May 2019 22:46:44 +0200 Subject: In-depth robustness. Reported by: clang static analyzer (clang-8) --- driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 6176bcb9..74e1b28a 100644 --- a/driver.c +++ b/driver.c @@ -542,8 +542,9 @@ static int fetch_messages(int mailserver_socket, struct query *ctl, lastnum = num + fetchsizelimit - 1; if (lastnum > count) lastnum = count; - for (i = 0; i < fetchsizelimit; i++) - (*msgsizes)[i] = 0; + if (*msgsizes) + for (i = 0; i < fetchsizelimit; i++) + (*msgsizes)[i] = 0; stage = STAGE_GETSIZES; err = (ctl->server.base_protocol->getpartialsizes)(mailserver_socket, num, lastnum, *msgsizes); -- cgit v1.2.3