Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-27 Thread Zlomek, Josef
On Mon, Jul 27, 2020 at 8:57 PM Marton Balint wrote: > It should be implemented in a way which does not use a temporary buffer. > Seems doable. > You are right. I will submit a new version. Best regards, Josef ___ ffmpeg-devel mailing list

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-27 Thread Marton Balint
On Mon, 27 Jul 2020, Steven Liu wrote: Marton Balint 于2020年7月25日周六 下午5:40写道: On Sat, 25 Jul 2020, Zlomek, Josef wrote: > Hi Steven, > > It is better but still not correct. Consider this test: > > test("http://server/foo/bar;, > "a/b/../c/d/../e../.../..f/g../h../other/url/a.mp3/..."); >

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-27 Thread Nicolas George
Steven Liu (12020-07-27): > What about use av_malloc? or bprint? > I think use av_malloc maybe easter to me. For internal APIs, definitely BPrint over naive av_malloc(). But this is unrelated to the issue at hand: the size limit exists in the caller of this function, not in this function.

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-27 Thread Steven Liu
Marton Balint 于2020年7月25日周六 下午5:40写道: > > > > On Sat, 25 Jul 2020, Zlomek, Josef wrote: > > > Hi Steven, > > > > It is better but still not correct. Consider this test: > > > > test("http://server/foo/bar;, > > "a/b/../c/d/../e../.../..f/g../h../other/url/a.mp3/..."); > > It should give " > >

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-26 Thread Zlomek, Josef
I will submit patch on monday. Josef On Sat, Jul 25, 2020 at 8:27 AM 刘歧 wrote: > > > 在 2020/7/25 下午2:11,“ffmpeg-devel 代表 Zlomek, Josef”< > ffmpeg-devel-boun...@ffmpeg.org 代表 jo...@pex.com> 写入: > > Hi Steven, > > It is better but still not correct. Consider this test: > >

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Steven Liu
Marton Balint 于2020年7月25日周六 下午5:40写道: > And I also would like to point out that using static strings with > MAX_URL_SIZE is not OK. This function supports an arbitrary buffer size, > so limiting it to MAX_URL_SIZE is a bug. Okay, get it, i'm reworking. Thanks Steven

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Marton Balint
On Sat, 25 Jul 2020, Zlomek, Josef wrote: Hi Steven, It is better but still not correct. Consider this test: test("http://server/foo/bar;, "a/b/../c/d/../e../.../..f/g../h../other/url/a.mp3/..."); It should give " http://server/foo/bar/a/c/e../.../..f/g../h../other/url/a.mp3/...;. I think

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Steven Liu
Nicolas George 于2020年7月25日周六 下午4:44写道: > > Steven Liu (12020-07-25): > > > And I think you would better rework the complete logic of the test: > > agreed, I think need lots of testcase for the logic, ../ .../.. > > dummy../... .../..dummy and so on, > > maybe need spend some time to do it :D > >

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Nicolas George
Steven Liu (12020-07-25): > > And I think you would better rework the complete logic of the test: > agreed, I think need lots of testcase for the logic, ../ .../.. > dummy../... .../..dummy and so on, > maybe need spend some time to do it :D I did not mean the FATE test for this feature, I meant

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Steven Liu
Nicolas George 于2020年7月25日周六 下午4:31写道: > > Steven Liu (12020-07-25): > > fix ticket: 8814 > > if get ".." in the url, check next byte and lead byte by double dot, > > it there have no '/' and not root node, it is not used go to directory ".." > > > > Signed-off-by: Steven Liu > > --- > >

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Nicolas George
刘歧 (12020-07-25): > I think the best would be to use strtok(p, "/") to split the path into the > components and for each ".." component remove the previous one (if there > are some still). > I think you can submit patch if you have full idea for it. strtok() is a terrible API, and

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Nicolas George
Steven Liu (12020-07-25): > fix ticket: 8814 > if get ".." in the url, check next byte and lead byte by double dot, > it there have no '/' and not root node, it is not used go to directory ".." > > Signed-off-by: Steven Liu > --- > libavformat/url.c | 12 > 1 file changed, 12

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread 刘歧
在 2020/7/25 下午2:11,“ffmpeg-devel 代表 Zlomek, Josef” 写入: Hi Steven, It is better but still not correct. Consider this test: test("http://server/foo/bar;, "a/b/../c/d/../e../.../..f/g../h../other/url/a.mp3/..."); It should give "

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-25 Thread Zlomek, Josef
Hi Steven, It is better but still not correct. Consider this test: test("http://server/foo/bar;, "a/b/../c/d/../e../.../..f/g../h../other/url/a.mp3/..."); It should give " http://server/foo/bar/a/c/e../.../..f/g../h../other/url/a.mp3/...;. I think the best would be to use strtok(p, "/") to

[FFmpeg-devel] [PATCH v2 1/2] avformat/url: check double dot is not to parent directory

2020-07-24 Thread Steven Liu
fix ticket: 8814 if get ".." in the url, check next byte and lead byte by double dot, it there have no '/' and not root node, it is not used go to directory ".." Signed-off-by: Steven Liu --- libavformat/url.c | 12 1 file changed, 12 insertions(+) diff --git a/libavformat/url.c