← Commit list

d74c0ada4e

Daniel Stenberg
Daniel Stenberg
2026-05-17
SUCCESS Duration: 286s

Subject

urlapi: prevent a terminal `.0x` component to normalize IPv4

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/urlapi.c+2 -0
@@ -523,6 +523,8 @@ UNITTEST int ipv4_normalize(struct dynbuf *host)
if(c[1] == 'x') {
c += 2; /* skip the prefix */
rc = curlx_str_hex(&c, &l, UINT_MAX);
+ if(rc)
+ return HOST_NAME;
}
else
rc = curlx_str_octal(&c, &l, UINT_MAX);
tests/libtest/lib1560.c+4 -0
@@ -625,6 +625,10 @@ static const struct testcase get_parts_list[] = {
};
static const struct urltestcase get_url_list[] = {
+ {"https://127.1.0x", "https://127.1.0x/", 0, 0, CURLUE_OK},
+ {"https://127.0x", "https://127.0x/", 0, 0, CURLUE_OK},
+ {"https://127.0x.1", "https://127.0x.1/", 0, 0, CURLUE_OK},
+ {"https://127.1.1.0x", "https://127.1.1.0x/", 0, 0, CURLUE_OK},
{"https://127.1.", "https://127.0.0.1/", 0, 0, CURLUE_OK},
{"https://127.1.:443", "https://127.0.0.1:443/", 0, 0, CURLUE_OK},
{"https://127.1.?moo", "https://127.0.0.1/?moo", 0, 0, CURLUE_OK},