summaryrefslogtreecommitdiff
path: root/gpxe/src/core/uri.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/core/uri.c')
-rw-r--r--gpxe/src/core/uri.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gpxe/src/core/uri.c b/gpxe/src/core/uri.c
index cf2b071d..7bb46da0 100644
--- a/gpxe/src/core/uri.c
+++ b/gpxe/src/core/uri.c
@@ -92,8 +92,12 @@ struct uri * parse_uri ( const char *uri_string ) {
uri->fragment = tmp;
}
- /* Identify absolute/relative URI */
- if ( ( tmp = strchr ( raw, ':' ) ) ) {
+ /* Identify absolute/relative URI. We ignore schemes that are
+ * apparently only a single character long, since otherwise we
+ * misinterpret a DOS-style path name ("C:\path\to\file") as a
+ * URI with scheme="C",opaque="\path\to\file".
+ */
+ if ( ( tmp = strchr ( raw, ':' ) ) && ( tmp > ( raw + 1 ) ) ) {
/* Absolute URI: identify hierarchical/opaque */
uri->scheme = raw;
*(tmp++) = '\0';