[evolution-data-server] Bug #643095 - Crash when opening invalid multipart/signed message



commit b839f57cc531cfbfb0e00694e14bb8381ba035b4
Author: Milan Crha <mcrha redhat com>
Date:   Wed Feb 23 18:21:18 2011 +0100

    Bug #643095 - Crash when opening invalid multipart/signed message

 camel/camel-multipart-signed.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-multipart-signed.c b/camel/camel-multipart-signed.c
index 0300d67..1375ab3 100644
--- a/camel/camel-multipart-signed.c
+++ b/camel/camel-multipart-signed.c
@@ -60,6 +60,10 @@ multipart_signed_clip_stream (CamelMultipartSigned *mps,
 	gssize n_read;
 	gsize length;
 
+	g_return_val_if_fail (start != -1, NULL);
+	g_return_val_if_fail (end != -1, NULL);
+	g_return_val_if_fail (end >= start, NULL);
+
 	data_wrapper = CAMEL_DATA_WRAPPER (mps);
 	stream = data_wrapper->stream;
 
@@ -192,6 +196,9 @@ multipart_signed_parse_content (CamelMultipartSigned *mps)
 	g_object_unref (cmp);
 
 	if (mps->end2 == -1 || mps->start2 == -1) {
+		if (mps->end1 == -1)
+			mps->start1 = -1;
+
 		return -1;
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]