aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-file-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-file-utils.c')
-rw-r--r--camel/camel-file-utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c
index 540fef2739..f4ed4cd22c 100644
--- a/camel/camel-file-utils.c
+++ b/camel/camel-file-utils.c
@@ -259,8 +259,10 @@ camel_file_util_encode_string (FILE *out, const char *str)
if (str == NULL)
return camel_file_util_encode_uint32 (out, 1);
-
- len = strlen (str);
+
+ if ((len = strlen (str)) > 65536)
+ len = 65536;
+
if (camel_file_util_encode_uint32 (out, len+1) == -1)
return -1;
if (len == 0 || fwrite (str, len, 1, out) == 1)