diff mbox series

[FFmpeg-devel,2/3] avformat/tests/url: add test cases for handling of double dot

Message ID 20200727105629.5510-2-josef@pex.com
State Superseded
Headers show
Series [FFmpeg-devel,1/3] avformat/url: fix logic for removing ".." path components
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zlomek, Josef July 27, 2020, 10:56 a.m. UTC
Signed-off-by: Josef Zlomek <josef@pex.com>
---
 libavformat/tests/url.c | 2 ++
 tests/ref/fate/url      | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
index 1d961a1b43..d7f14da49e 100644
--- a/libavformat/tests/url.c
+++ b/libavformat/tests/url.c
@@ -67,6 +67,8 @@  int main(void)
     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", "a/b/../c/d/../e../..f/.../other/url/test..mp3");
+    test("http://server/foo/bar", "/a/b/../c/d/../e../..f/.../other/url/test..mp3");
     test("http://server/foo/bar", "/../../../../../other/url");
     test("http://server/foo/bar", "/test/../../../../../other/url");
     test("http://server/foo/bar", "/test/../../test/../../../other/url");
diff --git a/tests/ref/fate/url b/tests/ref/fate/url
index 533ba2cb1e..8be9979c0b 100644
--- a/tests/ref/fate/url
+++ b/tests/ref/fate/url
@@ -14,6 +14,8 @@  Testing ff_make_absolute_url:
             http://server/foo/bar?param&otherparam ?someparam           => http://server/foo/bar?someparam
                              http://server/foo/bar //other/url          => http://other/url
                              http://server/foo/bar ../../../../../other/url => http://server/other/url
+                             http://server/foo/bar a/b/../c/d/../e../..f/.../other/url/test..mp3 => http://server/foo/a/c/e../..f/.../other/url/test..mp3
+                             http://server/foo/bar /a/b/../c/d/../e../..f/.../other/url/test..mp3 => http://server/a/c/e../..f/.../other/url/test..mp3
                              http://server/foo/bar /../../../../../other/url => http://server/other/url
                              http://server/foo/bar /test/../../../../../other/url => http://server/other/url
                              http://server/foo/bar /test/../../test/../../../other/url => http://server/other/url