author | alwin <alwin> | 2003-12-18 13:04:40 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-18 13:04:40 (UTC) |
commit | 51e56afac97c5254abfe76b65fd697a3e75e4bdd (patch) (side-by-side diff) | |
tree | bddd6c5702eea7b7580b167819c276e12c16786e | |
parent | 51c05cb39c940cdce7c9a358db0c2522d4930b9b (diff) | |
download | opie-51e56afac97c5254abfe76b65fd697a3e75e4bdd.zip opie-51e56afac97c5254abfe76b65fd697a3e75e4bdd.tar.gz opie-51e56afac97c5254abfe76b65fd697a3e75e4bdd.tar.bz2 |
patch for possible segfault wenn translating charsets
-rw-r--r-- | noncore/net/mail/libetpanstuff/mailmime_decode.c_arm_031_patch | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/noncore/net/mail/libetpanstuff/mailmime_decode.c_arm_031_patch b/noncore/net/mail/libetpanstuff/mailmime_decode.c_arm_031_patch new file mode 100644 index 0000000..2963a14 --- a/dev/null +++ b/noncore/net/mail/libetpanstuff/mailmime_decode.c_arm_031_patch @@ -0,0 +1,49 @@ +--- mailmime_decode.c.orig 2003-12-18 13:52:20.000000000 +0100 ++++ mailmime_decode.c 2003-12-18 13:50:46.000000000 +0100 +@@ -102,8 +102,8 @@ + size_t cur_token; + int r; + int res; +- char * str; +- char * wordutf8; ++ char * str = 0; ++ char * wordutf8 = 0; + int type; + + cur_token = * index; +@@ -147,14 +147,14 @@ + goto free; + } + +- if (mmap_string_append(gphrase, wordutf8) == NULL) { ++ if (wordutf8==NULL || mmap_string_append(gphrase, wordutf8) == NULL) { + mailmime_encoded_word_free(word); +- free(wordutf8); ++ if (wordutf8) free(wordutf8); + res = MAILIMF_ERROR_MEMORY; + goto free; + } + mailmime_encoded_word_free(word); +- free(wordutf8); ++ if (wordutf8) free(wordutf8); + first = FALSE; + } + else if (r == MAILIMF_ERROR_PARSE) { +@@ -183,14 +183,14 @@ + r = charconv(tocode, default_fromcode, raw_word, + strlen(raw_word), &wordutf8); + +- if (mmap_string_append(gphrase, wordutf8) == NULL) { +- free(wordutf8); ++ if (wordutf8==NULL || mmap_string_append(gphrase, wordutf8) == NULL) { ++ if (wordutf8)free(wordutf8); + mailimf_word_free(raw_word); + res = MAILIMF_ERROR_MEMORY; + goto free; + } + +- free(wordutf8); ++ if (wordutf8) free(wordutf8); + mailimf_word_free(raw_word); + first = FALSE; + } |