]> granicus.if.org Git - neomutt/commitdiff
It seems like libidn doesn't like to translate NULL pointers.
authorThomas Roessler <roessler@does-not-exist.org>
Fri, 7 Mar 2003 08:18:06 +0000 (08:18 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Fri, 7 Mar 2003 08:18:06 +0000 (08:18 +0000)
mutt_idna.c

index 1432375a2d15b7194b5c55ebef3897af09d74101..34487c40c5462a0d1e9c6bebe14c10ede17019a5 100644 (file)
@@ -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)