[tin-dev] [PATCH] possible NULL dereference in idna_decode with libicuuc

Urs Janßen urs at tin.org
Fri Jan 27 09:57:53 CET 2017


=== modified file 'src/misc.c'
--- src/misc.c	2016-10-12 15:40:33 +0000
+++ src/misc.c	2017-01-27 08:36:26 +0000
@@ -3803,12 +3803,13 @@
 			char *t;
 
 			*s = '\0'; /* cut off domainpart */
-			s = UChar2char(dest); /* convert domainpart */
-			t = my_malloc(strlen(out) + strlen(s) + 1);
-			sprintf(t, "%s%s", out, s);
-			free(s);
-			free(out);
-			out = t;
+			if ((s = UChar2char(dest)) != NULL) { /* convert domainpart */
+				t = my_malloc(strlen(out) + strlen(s) + 1);
+				sprintf(t, "%s%s", out, s);
+				free(s);
+				free(out);
+				out = t;
+			}
 		}
 	}
 #	else



More information about the tin-dev mailing list