Added check for null being passed to convert_ulabel_to_alabel() and convert_alabel_to_ulabel()

This commit is contained in:
Melinda Shore 2014-01-13 14:11:28 -08:00
parent 4e7bd2e5cf
commit 4866a4314a
1 changed files with 4 additions and 0 deletions

View File

@ -97,6 +97,8 @@ getdns_convert_ulabel_to_alabel(char *ulabel)
char *buf;
char *prepped;
if (ulabel == NULL)
return 0;
setlocale(LC_ALL, "");
if ((prepped = stringprep_locale_to_utf8(ulabel)) == 0)
return 0;
@ -125,6 +127,8 @@ getdns_convert_alabel_to_ulabel(char *alabel)
int ret; /* just in case we might want to use it someday */
char *buf;
if (alabel == NULL)
return 0;
if ((ret = idna_to_unicode_8z8z(alabel, &buf, 0)) != IDNA_SUCCESS) {
return NULL;
}