summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-11-12 11:12:54 +0000
committerMilan Crha <mcrha@src.gnome.org>2007-11-12 11:12:54 +0000
commit16705ff588fceb0c5af80c43459c41c4f18fad82 (patch)
treeb7679d4eac298e4e10156f7881c4c1ef033de17e
parent30872c28c524ad3bebf9200e79a17586c1dd7320 (diff)
downloadevolution-data-server-16705ff588fceb0c5af80c43459c41c4f18fad82.tar.gz
** Fix for bug #495086
2007-11-12 Milan Crha <mcrha@redhat.com> ** Fix for bug #495086 * camel-imap-utils.c: (imap_body_decode): Check for NULL too, so do not crash when something goes wrong. svn path=/branches/gnome-2-20/; revision=8197
-rw-r--r--camel/providers/imap/ChangeLog7
-rw-r--r--camel/providers/imap/camel-imap-utils.c8
2 files changed, 11 insertions, 4 deletions
diff --git a/camel/providers/imap/ChangeLog b/camel/providers/imap/ChangeLog
index 7ce74c5e3..5381a71be 100644
--- a/camel/providers/imap/ChangeLog
+++ b/camel/providers/imap/ChangeLog
@@ -1,3 +1,10 @@
+2007-11-12 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #495086
+
+ * camel-imap-utils.c: (imap_body_decode):
+ Check for NULL too, so do not crash when something goes wrong.
+
2007-11-05 Milan Crha <mcrha@redhat.com>
** Fix for bug #430420
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c
index f056e7843..f7f65ea48 100644
--- a/camel/providers/imap/camel-imap-utils.c
+++ b/camel/providers/imap/camel-imap-utils.c
@@ -989,7 +989,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
/* envelope */
imap_skip_list (&inptr);
- if (*inptr++ != ' ')
+ if (!inptr || *inptr++ != ' ')
goto exception;
/* body */
@@ -997,14 +997,14 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
goto exception;
child->parent = ci;
- if (*inptr++ != ' ')
+ if (!inptr || *inptr++ != ' ')
goto exception;
/* lines */
strtoul ((const char *) inptr, &p, 10);
inptr = (const unsigned char *) p;
} else if (camel_content_type_is (ctype, "text", "*")) {
- if (*inptr++ != ' ')
+ if (!inptr || *inptr++ != ' ')
goto exception;
/* lines */
@@ -1014,7 +1014,7 @@ imap_body_decode (const char **in, CamelMessageContentInfo *ci, CamelFolder *fol
/* body_type_basic */
}
- if (*inptr++ != ')')
+ if (!inptr || *inptr++ != ')')
goto exception;
ci->type = ctype;