]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[uri] Allow for relative URIs that include colons within the path 555/head
authorMichael Brown <mcb30@ipxe.org>
Thu, 13 Jan 2022 14:53:36 +0000 (14:53 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 13 Jan 2022 15:03:22 +0000 (15:03 +0000)
commite814d33900992e034a8c3ddec2c65463c5206090
treedae1062d5eb6642c724d3204d442e67c9b20efa4
parentf4f9adf618cd85d330a896e1f721f3aa78d2409d
[uri] Allow for relative URIs that include colons within the path

RFC3986 allows for colons to appear within the path component of a
relative URI, but iPXE will currently parse such URIs incorrectly by
interpreting the text before the colon as the URI scheme.

Fix by checking for valid characters when identifying the URI scheme.
Deliberately deviate from the RFC3986 definition of valid characters
by accepting "_" (which was incorrectly used in the iPXE-specific
"ib_srp" URI scheme and so must be accepted for compatibility with
existing deployments), and by omitting the code to check for
characters that are not used in any URI scheme supported by iPXE.

Reported-by: Ignat Korchagin <ignat@cloudflare.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/uri.c
src/tests/uri_test.c