From 0375fe59093058d4987af5d74a53a283c3651000 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 14 Feb 2010 22:38:41 -0500 Subject: [PATCH] [SoupURI] additional fixes to previous commit --- libsoup/soup-uri.c | 2 ++ tests/uri-parsing.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/libsoup/soup-uri.c b/libsoup/soup-uri.c index b1e5e59..77a0653 100644 --- a/libsoup/soup-uri.c +++ b/libsoup/soup-uri.c @@ -198,6 +198,8 @@ soup_uri_new_with_base (SoupURI *base, const char *uri_string) uri_string += 2; path = uri_string + strcspn (uri_string, "/?#"); + if (path > end) + path = end; at = strchr (uri_string, '@'); if (at && at < path) { colon = strchr (uri_string, ':'); diff --git a/tests/uri-parsing.c b/tests/uri-parsing.c index 49a92a6..c5aa6b5 100644 --- a/tests/uri-parsing.c +++ b/tests/uri-parsing.c @@ -59,6 +59,8 @@ static struct { "http://host/path%20with%20spaces" }, { " http://host/path", "http://host/path" }, { "http://host/path ", "http://host/path" }, + { "http://host ", "http://host/" }, + { "http://host:999 ", "http://host:999/" }, { "http://host/pa\nth", "http://host/path" }, { "http:\r\n//host/path", "http://host/path" }, { "http://\thost/path", "http://host/path" }, -- 2.7.4