aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.c
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 /camel/camel-mime-utils.c
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
Diffstat (limited to 'camel/camel-mime-utils.c')
-rw-r--r--camel/camel-mime-utils.c7
1 files changed, 4 insertions, 3 deletions
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)