summaryrefslogtreecommitdiff
path: root/libsoup/soup-uri.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-07-13 11:55:00 -0400
committerDan Winship <danw@gnome.org>2013-07-13 11:58:04 -0400
commit2e436f5c75fcff49518a33eee6429a23f556ec6d (patch)
treee0f814abdc28940aa2b57da2c9021ea5063852e3 /libsoup/soup-uri.c
parent74f27b8305cfbcf9324a07bea93829237c86e687 (diff)
downloadlibsoup-2e436f5c75fcff49518a33eee6429a23f556ec6d.tar.gz
soup-uri: fix URI scheme parsing
The URI grammar allows a scheme to have digits in it after the first character, and doesn't allow [.+-] in the first character. https://bugzilla.gnome.org/show_bug.cgi?id=703776
Diffstat (limited to 'libsoup/soup-uri.c')
-rw-r--r--libsoup/soup-uri.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c
index b9ff93fe..16098f69 100644
--- a/libsoup/soup-uri.c
+++ b/libsoup/soup-uri.c
@@ -263,10 +263,13 @@ soup_uri_new_with_base (SoupURI *base, const char *uri_string)
end = hash;
}
- /* Find scheme: initial [a-z+.-]* substring until ":" */
+ /* Find scheme */
p = uri_string;
while (p < end && (g_ascii_isalpha (*p) ||
- *p == '.' || *p == '+' || *p == '-'))
+ (p > uri_string && (g_ascii_isdigit (*p) ||
+ *p == '.' ||
+ *p == '+' ||
+ *p == '-'))))
p++;
if (p > uri_string && *p == ':') {