talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 06e09c818f9455537e82e8395d658e0be336f873
parent 31d93a0fc959abdad1733e393e6ef65302958751
Author: Paul <paul@claws-mail.org>
Date:   Wed, 24 Apr 2013 10:19:48 +0100

further fix to bug #2862, 'Segmentation fault when replying to a message where the "code conversion" fails'

Diffstat:
Msrc/procmime.c | 17++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/procmime.c b/src/procmime.c @@ -798,17 +798,16 @@ gboolean procmime_scan_text_content(MimeInfo *mimeinfo, } else if (mimeinfo->type == MIMETYPE_TEXT) { while (SC_FGETS(buf, sizeof(buf), tmpfp) != NULL) { str = conv_codeset_strdup(buf, src_codeset, CS_UTF_8); + if (!str) + str = conv_codeset_strdup(buf, conv_get_locale_charset_str(), CS_UTF_8); if (str) { - if ((scan_ret = scan_callback(str, cb_data)) == TRUE) { - g_free(str); - break; - } - g_free(str); - } else { + if ((scan_ret = scan_callback(str, cb_data)) == TRUE) { + g_free(str); + break; + } + g_free(str); + } else conv_fail = TRUE; - if ((scan_ret = scan_callback(str, cb_data)) == TRUE) - break; - } } }