From 9bb800a49acaef0dc19916e5ae00c941292d2515 Mon Sep 17 00:00:00 2001 From: hiro Date: Mon, 6 Nov 2006 06:23:04 +0000 Subject: fixed a crash when printing a message with empty Subject, From, and To. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1266 ee746299-78ed-0310-b773-934348b2243d --- libsylph/codeconv.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libsylph/codeconv.c') diff --git a/libsylph/codeconv.c b/libsylph/codeconv.c index c05a1db5..6a16513c 100644 --- a/libsylph/codeconv.c +++ b/libsylph/codeconv.c @@ -1328,7 +1328,9 @@ void conv_code_converter_destroy(CodeConverter *conv) gchar *conv_convert(CodeConverter *conv, const gchar *inbuf) { - if (conv->code_conv_func != conv_noconv) + if (!inbuf) + return NULL; + else if (conv->code_conv_func != conv_noconv) return conv->code_conv_func(inbuf, NULL); else return conv_iconv_strdup @@ -1342,6 +1344,12 @@ gchar *conv_codeset_strdup_full(const gchar *inbuf, { CodeConvFunc conv_func; + if (!inbuf) { + if (error) + *error = 0; + return NULL; + } + src_encoding = conv_get_fallback_for_private_encoding(src_encoding); conv_func = conv_get_code_conv_func(src_encoding, dest_encoding); @@ -1486,6 +1494,12 @@ gchar *conv_iconv_strdup_with_cd(const gchar *inbuf, iconv_t cd, gint *error) size_t len; gint error_ = 0; + if (!inbuf) { + if (error) + *error = 0; + return NULL; + } + inbuf_p = inbuf; in_size = strlen(inbuf); in_left = in_size; -- cgit v1.2.3