← Commit list

a8e6f90a69

tiymat
tiymat
2026-05-27
SUCCESS Duration: 241s

Subject

urlapi: forbid '|' in host

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+1 -1
@@ -471,7 +471,7 @@ static CURLUcode hostname_check(struct Curl_URL *u, char *hostname,
return ipv6_parse(u, hostname, hlen);
else {
/* letters from the second string are not ok */
- len = strcspn(hostname, " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%");
+ len = strcspn(hostname, " \r\n\t/:#?!@{}[]\\$\'\"^`*<>=;,+&()%|");
if(hlen != len)
/* hostname with bad content */
return CURLUE_BAD_HOSTNAME;
tests/libtest/lib1560.c+1 -0
@@ -326,6 +326,7 @@ static const struct testcase get_parts_list[] = {
{"https://[email protected]?he l lo",
"https | user | [12] | [13] | example.net | [15] | / | he l lo | [17]",
CURLU_ALLOW_SPACE, 0, CURLUE_OK},
+ {"https://exam|ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://exam{}[]ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://exam{ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://exam}ple.net", "", 0, 0, CURLUE_BAD_HOSTNAME},