aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-03-10 04:36:12 +0800
committerDan Winship <danw@src.gnome.org>2001-03-10 04:36:12 +0800
commitb3bb38e0361503322c2d3603f0ef1fd71b96f060 (patch)
treef309e92da922bf25a496dc0028614507fb462580
parent62d28aab75e5975830a8b8aee152dc11247ec7f2 (diff)
downloadgsoc2013-evolution-b3bb38e0361503322c2d3603f0ef1fd71b96f060.tar.gz
gsoc2013-evolution-b3bb38e0361503322c2d3603f0ef1fd71b96f060.tar.zst
gsoc2013-evolution-b3bb38e0361503322c2d3603f0ef1fd71b96f060.zip
Fix a bug that could make this walk off the end of a string. (The bug has
* camel-mime-utils.c (header_fold): Fix a bug that could make this walk off the end of a string. (The bug has been there since December... maybe this will fix some unreproduceable crashes?) svn path=/trunk/; revision=8619
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/camel-mime-utils.c7
2 files changed, 10 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index b3f6664ce1..ddc4f9366d 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,9 @@
+2001-03-09 Dan Winship <danw@ximian.com>
+
+ * camel-mime-utils.c (header_fold): Fix a bug that could make this
+ walk off the end of a string. (The bug has been there since
+ December... maybe this will fix some unreproduceable crashes?)
+
2001-03-08 Jeffrey Stedfast <fejj@ximian.com>
* camel-store.c (camel_store_get_folder): Changes so that the
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index db63e5d559..31b90c8417 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -3354,10 +3354,11 @@ header_fold(const char *in, int headerlen)
while (*p) {
n = strchr(p, '\n');
if (n == NULL) {
- n = p+strlen(p);
- } else {
- needunfold = TRUE;
+ len += strlen (p);
+ break;
}
+
+ needunfold = TRUE;
len += n-p;
if (len >= CAMEL_FOLD_SIZE)