aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGisle Vanem <gvanem@broadpark.no>2004-10-06 18:55:58 +0000
committerGisle Vanem <gvanem@broadpark.no>2004-10-06 18:55:58 +0000
commit071218a201d5b86fbfdf1ae72a3ddf51633b8d99 (patch)
treea8d7a4834c1297b28689e4978839af6a7d8357d2
parentf0d6cc23ae53ce7e51bdb56ad03a2f9fd3aae2df (diff)
Fixed tld_check_name(). idna_to_unicode_lzlz() should never fail,
but return FALSE if 'uc_name == NULL' just in case.
-rw-r--r--lib/url.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/url.c b/lib/url.c
index e83836e74..51b171129 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2080,10 +2080,9 @@ static bool is_ASCII_name (const char *hostname)
/*
* Check if characters in hostname is allowed in Top Level Domain.
*/
-static bool tld_check_name (struct connectdata *conn,
+static bool tld_check_name (struct SessionHandle *data,
const char *ace_hostname)
{
- struct SessionHandle *data = conn->data;
size_t err_pos;
char *uc_name = NULL;
int rc;
@@ -2091,8 +2090,7 @@ static bool tld_check_name (struct connectdata *conn,
/* Convert (and downcase) ACE-name back into locale's character set */
rc = idna_to_unicode_lzlz(ace_hostname, &uc_name, 0);
if (rc != IDNA_SUCCESS)
- infof(data, "Failed to convert %s from ACE; %s\n",
- ace_hostname, Curl_idn_strerror(conn,rc));
+ return (FALSE);
rc = tld_check_lz(uc_name, &err_pos, NULL);
if (rc == TLD_INVALID)
@@ -2128,7 +2126,7 @@ static void fix_hostname(struct connectdata *conn, struct hostname *host)
infof(data, "Failed to convert %s to ACE; %s\n",
host->name, Curl_idn_strerror(conn,rc));
else {
- tld_check_name(conn, ace_hostname);
+ tld_check_name(data, ace_hostname);
host->encalloc = ace_hostname;
/* change the name pointer to point to the encoded hostname */