urlapi: accept 0X prefix in IPv4 address as well

Extend test 1560 accordingly

Closes #21820
This commit is contained in:
Daniel Stenberg 2026-05-31 23:23:45 +02:00
parent 780ccb256e
commit 1b6724882c
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 4 additions and 1 deletions

View file

@ -520,7 +520,7 @@ UNITTEST int ipv4_normalize(struct dynbuf *host)
int rc;
curl_off_t l;
if(*c == '0') {
if(c[1] == 'x') {
if(Curl_raw_tolower(c[1]) == 'x') {
c += 2; /* skip the prefix */
rc = curlx_str_hex(&c, &l, UINT_MAX);
if(rc)