dovecot-2.2: Make static analyzer happier.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 27 16:05:00 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/e97a8dd8d2b6
changeset: 19222:e97a8dd8d2b6
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 27 19:03:31 2015 +0300
description:
Make static analyzer happier.

diffstat:

 src/lib-mail/test-message-id.c                   |  3 ++-
 src/lib-storage/list/mailbox-list-index-status.c |  2 ++
 src/lib-storage/mail-namespace.c                 |  2 ++
 3 files changed, 6 insertions(+), 1 deletions(-)

diffs (37 lines):

diff -r 5e18e1386600 -r e97a8dd8d2b6 src/lib-mail/test-message-id.c
--- a/src/lib-mail/test-message-id.c	Sun Sep 27 18:58:08 2015 +0300
+++ b/src/lib-mail/test-message-id.c	Sun Sep 27 19:03:31 2015 +0300
@@ -27,7 +27,8 @@
 		while ((next_msgid = message_id_get_next(&msgid)) != NULL) {
 			if (output[j] == NULL)
 				break;
-			test_assert(strcmp(output[j++], next_msgid) == 0);
+			test_assert(strcmp(output[j], next_msgid) == 0);
+			j++;
 		}
 		test_assert(output[j++] == NULL && next_msgid == NULL);
 	}
diff -r 5e18e1386600 -r e97a8dd8d2b6 src/lib-storage/list/mailbox-list-index-status.c
--- a/src/lib-storage/list/mailbox-list-index-status.c	Sun Sep 27 18:58:08 2015 +0300
+++ b/src/lib-storage/list/mailbox-list-index-status.c	Sun Sep 27 19:03:31 2015 +0300
@@ -275,6 +275,8 @@
 	enum mailbox_metadata_items noncached_items;
 	int ret;
 
+	i_assert(metadata_r != NULL);
+
 	if (box->opened) {
 		/* if mailbox is already opened, don't bother using the values
 		   in mailbox list index. they have a higher chance of being
diff -r 5e18e1386600 -r e97a8dd8d2b6 src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c	Sun Sep 27 18:58:08 2015 +0300
+++ b/src/lib-storage/mail-namespace.c	Sun Sep 27 19:03:31 2015 +0300
@@ -321,6 +321,8 @@
 	struct mail_namespace *ns;
 	bool prefixless_found = FALSE;
 
+	i_assert(namespaces != NULL);
+
 	for (ns = namespaces; ns != NULL; ns = ns->next) {
 		if (ns->prefix_len == 0)
 			prefixless_found = TRUE;


More information about the dovecot-cvs mailing list