diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-02-13 19:55:33 +0000 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-02-13 19:55:33 +0000 |
commit | 26c586d9e72b03eba0512b8ea78d6f1d9a34eab0 (patch) | |
tree | bf4e8dea5ea0e6b48151d3b41727add762ebc8f1 | |
parent | a30b12ebbb538e6dfcb48110e5365f185e13a54c (diff) | |
download | evolution-data-server-26c586d9e72b03eba0512b8ea78d6f1d9a34eab0.tar.gz |
Since decoding a string doesn't allow strings longer than 65536, truncate
2004-02-12 Jeffrey Stedfast <fejj@ximian.com>
* camel-file-utils.c (camel_file_util_encode_string): Since
decoding a string doesn't allow strings longer than 65536,
truncate strings that are longer than 65536 here. Fixes bug
#54319.
-rw-r--r-- | camel/ChangeLog | 9 | ||||
-rw-r--r-- | camel/camel-file-utils.c | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 18b2a4ec9..1b22501c4 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2004-02-12 Jeffrey Stedfast <fejj@ximian.com> + + * camel-file-utils.c (camel_file_util_encode_string): Since + decoding a string doesn't allow strings longer than 65536, + truncate strings that are longer than 65536 here. Fixes bug + #54319. + 2004-02-03 Jeffrey Stedfast <fejj@ximian.com> * camel-vee-folder.c (folder_added_uid): 64bit fix. @@ -135,7 +142,7 @@ ** See bug #47208. - * camel-filter-search.c (match_all): match-all with no arguments + * camel-filter-search.c (match_all): match-all with no arguments should always return TRUE. * camel-folder-search.c (camel_folder_search_execute_expression): diff --git a/camel/camel-file-utils.c b/camel/camel-file-utils.c index f0e400eba..9c8d6fa23 100644 --- a/camel/camel-file-utils.c +++ b/camel/camel-file-utils.c @@ -249,8 +249,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) |