dovecot-2.2: Make static analyzer happier.

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 5 22:21:42 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/c3901ac774cb
changeset: 16658:c3901ac774cb
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 05 22:21:29 2013 +0300
description:
Make static analyzer happier.

diffstat:

 src/director/user-directory.c            |  3 ++-
 src/lib-http/test-http-response-parser.c |  1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r c41eab7d5d05 -r c3901ac774cb src/director/user-directory.c
--- a/src/director/user-directory.c	Mon Aug 05 22:16:02 2013 +0300
+++ b/src/director/user-directory.c	Mon Aug 05 22:21:29 2013 +0300
@@ -243,7 +243,8 @@
 	dir->head = dir->tail = NULL;
 	array_foreach(&users, userp)
 		DLLIST2_APPEND(&dir->head, &dir->tail, *userp);
-	i_assert(dir->head->timestamp <= dir->tail->timestamp);
+	i_assert(dir->head != NULL &&
+		 dir->head->timestamp <= dir->tail->timestamp);
 	array_free(&users);
 }
 
diff -r c41eab7d5d05 -r c3901ac774cb src/lib-http/test-http-response-parser.c
--- a/src/lib-http/test-http-response-parser.c	Mon Aug 05 22:16:02 2013 +0300
+++ b/src/lib-http/test-http-response-parser.c	Mon Aug 05 22:21:29 2013 +0300
@@ -136,6 +136,7 @@
 		
 		if (ret == 0) {
 			/* verify last response only */
+			i_assert(response != NULL);
 			test_out(t_strdup_printf("response->status = %d",test->status),
 					response->status == test->status);
 			if (payload == NULL || test->payload == NULL) {


More information about the dovecot-cvs mailing list