dovecot-2.2: lib-mail: Added asserts to make static analyzer hap...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 7 20:27:30 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/fc4a19b17fb3
changeset: 17344:fc4a19b17fb3
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 07 23:26:57 2014 +0300
description:
lib-mail: Added asserts to make static analyzer happier

diffstat:

 src/lib-mail/message-parser.c |  3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r b68e9f4e797f -r fc4a19b17fb3 src/lib-mail/message-parser.c
--- a/src/lib-mail/message-parser.c	Wed May 07 23:25:50 2014 +0300
+++ b/src/lib-mail/message-parser.c	Wed May 07 23:26:57 2014 +0300
@@ -165,6 +165,8 @@
 {
 	struct message_part *p, *part, **list;
 
+	i_assert(parent != NULL);
+
 	part = p_new(pool, struct message_part, 1);
 	part->parent = parent;
 	for (p = parent; p != NULL; p = p->parent)
@@ -310,6 +312,7 @@
 		message_size_add(&part->parent->body_size, &part->body_size);
 		message_size_add(&part->parent->body_size, &part->header_size);
 	}
+	i_assert(part != NULL);
 	ctx->part = part;
 
 	if (boundary->epilogue_found) {


More information about the dovecot-cvs mailing list