summaryrefslogtreecommitdiff
path: root/libavformat/tests
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2020-04-29 12:50:57 +0800
committerSteven Liu <lq@chinaffmpeg.org>2020-05-06 12:00:26 +0800
commit648051f07cffd0d91c89dc6706e3d0d6a286de43 (patch)
tree1686d7a346ee92816a424325a95e2a7215e697cc /libavformat/tests
parent666dbe7aace54b103af09cd111a56822062528c1 (diff)
avformat/url: check url root node when rel include double dot and trim double dot
fix ticket: 8625 and add testcase into url for double dot corner case Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/tests')
-rw-r--r--libavformat/tests/url.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
index 5e484fd428..1d961a1b43 100644
--- a/libavformat/tests/url.c
+++ b/libavformat/tests/url.c
@@ -56,6 +56,7 @@ int main(void)
test("/foo/bar", "baz");
test("/foo/bar", "../baz");
test("/foo/bar", "/baz");
+ test("/foo/bar", "../../../baz");
test("http://server/foo/", "baz");
test("http://server/foo/bar", "baz");
test("http://server/foo/", "../baz");
@@ -65,6 +66,10 @@ int main(void)
test("http://server/foo/bar?param=value/with/slashes", "/baz");
test("http://server/foo/bar?param&otherparam", "?someparam");
test("http://server/foo/bar", "//other/url");
+ test("http://server/foo/bar", "../../../../../other/url");
+ test("http://server/foo/bar", "/../../../../../other/url");
+ test("http://server/foo/bar", "/test/../../../../../other/url");
+ test("http://server/foo/bar", "/test/../../test/../../../other/url");
printf("\nTesting av_url_split:\n");
test2("/foo/bar");