summaryrefslogtreecommitdiffstats
path: root/mutt_idna.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2003-03-07 08:18:06 +0000
committerThomas Roessler <roessler@does-not-exist.org>2003-03-07 08:18:06 +0000
commit4b7bf5c37b9144437382d3faf0340fd330b8aebb (patch)
tree7f703c3d53c1d984ac489f6bca10bb3ee3039dc3 /mutt_idna.c
parentd1db309090270e860f0b5c4cd2ea0d568c9b0416 (diff)
It seems like libidn doesn't like to translate NULL pointers.
Diffstat (limited to 'mutt_idna.c')
-rw-r--r--mutt_idna.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mutt_idna.c b/mutt_idna.c
index 1432375a..34487c40 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)