[FFmpeg-devel] [PATCH] libavformat/url: check url root node when rel include double dot

Steven Liu lq at chinaffmpeg.org
Mon Apr 27 13:38:39 EEST 2020



> 2020年4月27日 下午6:30,Martin Storsjö <martin at martin.st> 写道:
> 
> On Mon, 27 Apr 2020, Steven Liu wrote:
> 
>> fix ticket: 8625
>> 
>> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
>> ---
>> libavformat/url.c | 22 ++++++++++++++++++++--
>> 1 file changed, 20 insertions(+), 2 deletions(-)
>> 
>> diff --git a/libavformat/url.c b/libavformat/url.c
>> index 596fb49cfc..e5003f795a 100644
>> --- a/libavformat/url.c
>> +++ b/libavformat/url.c
>> @@ -81,6 +81,8 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
>>                          const char *rel)
>> {
>>    char *sep, *path_query;
>> +    char *root = NULL;
>> +    char *p = NULL;
>>    /* Absolute path, relative to the current server */
>>    if (base && strstr(base, "://") && rel[0] == '/') {
>>        if (base != buf)
> 
> There's a good set of tests for this function in libavformat/tests/url.c - please add a new testcase there for the thing you are implementing (and ideally, also any other closely related corner case).
Ok. Let me try to add them into the test case. Thanks Martin.
> 
> // Martin

Thanks

Steven Liu





More information about the ffmpeg-devel mailing list