From b3bb38e0361503322c2d3603f0ef1fd71b96f060 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 9 Mar 2001 20:36:12 +0000 Subject: 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 --- camel/ChangeLog | 6 ++++++ camel/camel-mime-utils.c | 7 ++++--- 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 + + * 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 * 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) -- cgit v1.2.3