From 0ea624ecb5ec7531925278765584f47a11281bf6 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Fri, 7 Mar 2003 08:18:06 +0000 Subject: [PATCH] It seems like libidn doesn't like to translate NULL pointers. --- mutt_idna.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mutt_idna.c b/mutt_idna.c index 1432375a2..34487c40c 100644 --- a/mutt_idna.c +++ b/mutt_idna.c @@ -43,6 +43,9 @@ int mutt_idna_to_local (const char *in, char **out, int flags) { *out = NULL; + if (!in) + goto notrans; + /* Is this the right function? Interesting effects with some bad identifiers! */ if (idna_to_unicode_utf8_from_utf8 (in, out, 1, 0) != IDNA_SUCCESS) goto notrans; @@ -90,6 +93,12 @@ int mutt_local_to_idna (const char *in, char **out) char *tmp = safe_strdup (in); *out = NULL; + if (!in) + { + *out = NULL; + return -1; + } + if (mutt_convert_string (&tmp, Charset, "utf-8", M_ICONV_HOOK_FROM) == -1) rv = -1; if (!rv && idna_to_ascii_from_utf8 (tmp, out, 1, 0) != IDNA_SUCCESS) -- 2.40.0