evolution-data-server r9685 - in branches/gnome-2-24: camel/providers/groupwise servers/groupwise



Author: abharath
Date: Fri Oct 17 08:11:12 2008
New Revision: 9685
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=9685&view=rev

Log:
2008-10-17  Milan Crha  <mcrha redhat com>

       ** Part of fix for bug #547243

       * e-gw-item.c: (e_gw_item_new_from_soap_parameter):
       * e-gw-connection.c: (e_gw_connection_get_attachment),
       (e_gw_connection_get_attachment_base64):
       Check for correct values to prevent invalid reads.


Modified:
   branches/gnome-2-24/camel/providers/groupwise/ChangeLog
   branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c
   branches/gnome-2-24/servers/groupwise/ChangeLog
   branches/gnome-2-24/servers/groupwise/e-gw-connection.c
   branches/gnome-2-24/servers/groupwise/e-gw-item.c

Modified: branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c
==============================================================================
--- branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c	(original)
+++ branches/gnome-2-24/camel/providers/groupwise/camel-groupwise-folder.c	Fri Oct 17 08:11:12 2008
@@ -1774,7 +1774,7 @@
 
 
 	msg = camel_mime_message_new ();
-	if (has_mime_822) {
+	if (has_mime_822 && body) {
 		temp_stream = camel_stream_mem_new_with_buffer (body, body_len);
 		if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *) msg, temp_stream) == -1) {
 			camel_object_unref (msg);

Modified: branches/gnome-2-24/servers/groupwise/e-gw-connection.c
==============================================================================
--- branches/gnome-2-24/servers/groupwise/e-gw-connection.c	(original)
+++ branches/gnome-2-24/servers/groupwise/e-gw-connection.c	Fri Oct 17 08:11:12 2008
@@ -2726,10 +2726,13 @@
 		buffer = soup_soap_parameter_get_string_value (param) ;
 	}
 
-	if (buffer && buf_length) {
+	if (buffer && buf_length && atoi (buf_length) > 0) {
 		gsize len = atoi (buf_length) ;
 		*attachment = g_base64_decode (buffer,&len) ;
 		*attach_length = len ;
+	} else {
+		*attachment = NULL;
+		*attach_length = 0;
 	}
 
 	/* free memory */
@@ -2794,7 +2797,7 @@
 		buffer = soup_soap_parameter_get_string_value (param) ;
 	}
 
-	if (buffer && buf_length) {
+	if (buffer && buf_length && atoi (buf_length) > 0) {
 		int len = atoi (buf_length) ;
 		*attachment = g_strdup (buffer);
 		*attach_length = len;
@@ -2802,6 +2805,10 @@
 			*offset_r = atoi (o_return);
 		else 
 			*offset_r = 0;
+	} else {
+		*attachment = NULL;
+		*attach_length = 0;
+		*offset_r = 0;
 	}
 
 	/* free memory */

Modified: branches/gnome-2-24/servers/groupwise/e-gw-item.c
==============================================================================
--- branches/gnome-2-24/servers/groupwise/e-gw-item.c	(original)
+++ branches/gnome-2-24/servers/groupwise/e-gw-item.c	Fri Oct 17 08:11:12 2008
@@ -1951,7 +1951,7 @@
 			msg = soup_soap_parameter_get_string_value (part);
 			length = soup_soap_parameter_get_property (part, "length");
 
-			if (msg && length) {
+			if (msg && length && atoi (length) > 0) {
 				len = atoi (length);
 				item->priv->message = g_base64_decode  (msg, &len);
 				if (!(item->priv->message)) {



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