dovecot-2.2: Make static analyzer happier.

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 17 00:44:20 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/178fe5bf943b
changeset: 16526:178fe5bf943b
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 17 00:03:16 2013 +0300
description:
Make static analyzer happier.

diffstat:

 src/doveadm/dsync/doveadm-dsync.c                |  3 +++
 src/doveadm/dsync/test-dsync-mailbox-tree-sync.c |  3 ++-
 src/imap-login/imap-proxy.c                      |  1 +
 src/pop3-login/pop3-proxy.c                      |  1 +
 4 files changed, 7 insertions(+), 1 deletions(-)

diffs (48 lines):

diff -r 5a137e3eb51e -r 178fe5bf943b src/doveadm/dsync/doveadm-dsync.c
--- a/src/doveadm/dsync/doveadm-dsync.c	Mon Jun 17 00:31:22 2013 +0300
+++ b/src/doveadm/dsync/doveadm-dsync.c	Mon Jun 17 00:03:16 2013 +0300
@@ -299,6 +299,9 @@
 {
 	const char *path1, *path2;
 
+	i_assert(user1->namespaces != NULL);
+	i_assert(user2->namespaces != NULL);
+
 	return mailbox_list_get_root_path(user1->namespaces->list, type, &path1) &&
 		mailbox_list_get_root_path(user2->namespaces->list, type, &path2) &&
 		strcmp(path1, path2) == 0;
diff -r 5a137e3eb51e -r 178fe5bf943b src/doveadm/dsync/test-dsync-mailbox-tree-sync.c
--- a/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c	Mon Jun 17 00:31:22 2013 +0300
+++ b/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c	Mon Jun 17 00:03:16 2013 +0300
@@ -624,7 +624,8 @@
 	node_create(tree2, 3, "1/0/2", 0);
 
 	test_trees_nofree(tree1, &tree2);
-	test_assert(tree1->root.first_child->next == NULL);
+	test_assert(tree1->root.first_child != NULL &&
+		    tree1->root.first_child->next == NULL);
 	dsync_mailbox_tree_deinit(&tree1);
 	test_end();
 }
diff -r 5a137e3eb51e -r 178fe5bf943b src/imap-login/imap-proxy.c
--- a/src/imap-login/imap-proxy.c	Mon Jun 17 00:31:22 2013 +0300
+++ b/src/imap-login/imap-proxy.c	Mon Jun 17 00:03:16 2013 +0300
@@ -234,6 +234,7 @@
 			client_proxy_failed(client, TRUE);
 			return -1;
 		}
+		i_assert(ret == 0);
 
 		str_truncate(str, 0);
 		base64_encode(data, data_len, str);
diff -r 5a137e3eb51e -r 178fe5bf943b src/pop3-login/pop3-proxy.c
--- a/src/pop3-login/pop3-proxy.c	Mon Jun 17 00:31:22 2013 +0300
+++ b/src/pop3-login/pop3-proxy.c	Mon Jun 17 00:03:16 2013 +0300
@@ -110,6 +110,7 @@
 			error));
 		return -1;
 	}
+	i_assert(ret == 0);
 
 	str_truncate(str, 0);
 	base64_encode(data, data_len, str);


More information about the dovecot-cvs mailing list