aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)