aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2019-05-14 22:46:44 +0200
committerMatthias Andree <matthias.andree@gmx.de>2019-05-14 22:47:28 +0200
commit124518ae5fba9e352a9cf8a8d7c1a8160475d10b (patch)
tree12a8d57a0de3e20bc28bfae550631bce49b9723e /driver.c
parentb8f5a610eac4a90fc5e8f22c65184f7797abf7bb (diff)
downloadfetchmail-124518ae5fba9e352a9cf8a8d7c1a8160475d10b.tar.gz
fetchmail-124518ae5fba9e352a9cf8a8d7c1a8160475d10b.tar.bz2
fetchmail-124518ae5fba9e352a9cf8a8d7c1a8160475d10b.zip
In-depth robustness.
Reported by: clang static analyzer (clang-8)
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c5
1 files changed, 3 insertions, 2 deletions
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);