From 588a6e334ad2043631bffd51a18e7e081ab86160 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Wed, 7 Aug 2024 03:18:34 +0100 Subject: [PATCH] idn: more strictly check AppleIDN errors UIDNA API returns two error values but we were only checking one. Checking both better aligns the behaviour with that of libidn2. Closes #14431 --- docs/KNOWN_BUGS | 7 ------- lib/idn.c | 2 +- tests/data/DISABLED | 3 --- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS index cc5f1dd289..fce0f0ec9c 100644 --- a/docs/KNOWN_BUGS +++ b/docs/KNOWN_BUGS @@ -85,7 +85,6 @@ problems may have been fixed or changed somewhat since this was written. 11.4 HTTP test server 'connection-monitor' problems 11.5 Connection information when using TCP Fast Open 11.6 test cases sometimes timeout - 11.7 AppleIDN test failures 11.8 WinIDN test failures 12. LDAP @@ -528,12 +527,6 @@ problems may have been fixed or changed somewhat since this was written. See https://github.com/curl/curl/issues/13350 -11.7 AppleIDN test failures - - Test 1035 fail on macOS when built to use AppleIDN. - - See https://github.com/curl/curl/issues/14176 - 11.8 WinIDN test failures Test 165 disabled when built with WinIDN. diff --git a/lib/idn.c b/lib/idn.c index b1c1fcaa62..ac17718ef5 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -106,7 +106,7 @@ static CURLcode mac_idn_to_ascii(const char *in, char **out) (void)uidna_nameToASCII_UTF8(idna, iconv_buffer, (int)iconv_outlen, buffer, sizeof(buffer) - 1, &info, &err); uidna_close(idna); - if(!U_FAILURE(err)) { + if(!U_FAILURE(err) && !info.errors) { *out = strdup(buffer); if(*out) return CURLE_OK; diff --git a/tests/data/DISABLED b/tests/data/DISABLED index 0e6c79767a..5d20fa2fba 100644 --- a/tests/data/DISABLED +++ b/tests/data/DISABLED @@ -93,9 +93,6 @@ %if bearssl 313 %endif -%if AppleIDN -1035 -%endif %if WinIDN 165 %endif -- 2.47.3