[FFmpeg-devel] [PATCH 2/2] libavformat/tests/url: add test case of double dot is not directory

Steven Liu lq at chinaffmpeg.org
Fri Jul 24 17:21:37 EEST 2020


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/tests/url.c | 2 ++
 tests/ref/fate/url      | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libavformat/tests/url.c b/libavformat/tests/url.c
index 1d961a1b43..3e4e5c4247 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", "../../../../../other/url/test..mp3");
+    test("http://server/foo/bar", "../../../../../other/url/..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..c450192da1 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 ../../../../../other/url/test..mp3 => http://server/other/url/test..mp3
+                             http://server/foo/bar ../../../../../other/url/..mp3 => http://server/other/url/..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
-- 
2.25.0





More information about the ffmpeg-devel mailing list