test763: verify IDN hostname with zero width characters only

Bonus: fix memory leak in exit path from 967a626af4

Closes #18465
This commit is contained in:
Daniel Stenberg 2025-09-03 12:47:07 +02:00
parent 71c9706959
commit de86c2483f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 33 additions and 1 deletions

View file

@ -324,8 +324,10 @@ CURLcode Curl_idn_decode(const char *input, char **output)
}
#endif
if(!result) {
if(!d[0]) /* ended up zero length, not acceptable */
if(!d[0]) { /* ended up zero length, not acceptable */
result = CURLE_URL_MALFORMAT;
free(d);
}
else
*output = d;
}