diff mbox series

[FFmpeg-devel] avformat/url: check the result of the strrchr

Message ID 20200515100146.12548-1-lq@chinaffmpeg.org
State Accepted
Commit b707abf0911b1cb997bf8b1912c970e1e15996cf
Headers show
Series [FFmpeg-devel] avformat/url: check the result of the strrchr
Related show

Checks

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

Commit Message

Steven Liu May 15, 2020, 10:01 a.m. UTC
because it need be check for success, is should not
change the old way if it failure.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/url.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Liu May 15, 2020, 11:30 a.m. UTC | #1
Steven Liu <lq@chinaffmpeg.org> 于2020年5月15日周五 下午6:02写道:
>
> because it need be check for success, is should not
> change the old way if it failure.
Change the comments:
because it need be checked for success status, it should not
change the old way if it failure.
>
> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
> ---
>  libavformat/url.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/url.c b/libavformat/url.c
> index 7cd9e0c705..6956f6dc10 100644
> --- a/libavformat/url.c
> +++ b/libavformat/url.c
> @@ -182,7 +182,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
>
>      /* Remove the file name from the base url */
>      sep = strrchr(buf, '/');
> -    if (sep <= root)
> +    if (sep && sep <= root)
>          sep = root;
>
>      if (sep)
> --
> 2.25.0
>
>
>
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Steven Liu May 17, 2020, 2:35 a.m. UTC | #2
> 2020年5月15日 下午6:26,Steven Liu <lq@chinaffmpeg.org> 写道:
> 
> 
> 
>> 2020年5月15日 下午6:01,Steven Liu <lq@chinaffmpeg.org> 写道:
>> 
>> because it need be check for success, is should not
>> change the old way if it failure.
> Change the comments: 
> because it need be checked for success status, it should not
> change the old way if it failure.
>> 
>> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
>> ---
>> libavformat/url.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavformat/url.c b/libavformat/url.c
>> index 7cd9e0c705..6956f6dc10 100644
>> --- a/libavformat/url.c
>> +++ b/libavformat/url.c
>> @@ -182,7 +182,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
>> 
>>   /* Remove the file name from the base url */
>>   sep = strrchr(buf, '/');
>> -    if (sep <= root)
>> +    if (sep && sep <= root)
>>       sep = root;
>> 
>>   if (sep)
>> -- 
>> 2.25.0
>> 
>> 
>> 
>> 
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> 
> Thanks
> 
> Steven Liu

Ping

Thanks

Steven Liu
Steven Liu May 18, 2020, 4:29 a.m. UTC | #3
> 2020年5月17日 上午10:35,Steven Liu <lq@chinaffmpeg.org> 写道:
> 
> 
> 
>> 2020年5月15日 下午6:26,Steven Liu <lq@chinaffmpeg.org> 写道:
>> 
>> 
>> 
>>> 2020年5月15日 下午6:01,Steven Liu <lq@chinaffmpeg.org> 写道:
>>> 
>>> because it need be check for success, is should not
>>> change the old way if it failure.
>> Change the comments: 
>> because it need be checked for success status, it should not
>> change the old way if it failure.
>>> 
>>> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
>>> ---
>>> libavformat/url.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/libavformat/url.c b/libavformat/url.c
>>> index 7cd9e0c705..6956f6dc10 100644
>>> --- a/libavformat/url.c
>>> +++ b/libavformat/url.c
>>> @@ -182,7 +182,7 @@ void ff_make_absolute_url(char *buf, int size, const char *base,
>>> 
>>>  /* Remove the file name from the base url */
>>>  sep = strrchr(buf, '/');
>>> -    if (sep <= root)
>>> +    if (sep && sep <= root)
>>>      sep = root;
>>> 
>>>  if (sep)
>>> -- 
>>> 2.25.0
>>> 
> 

will apply after 24 hours if no objections.
> Ping
> 

Thanks

Steven Liu
diff mbox series

Patch

diff --git a/libavformat/url.c b/libavformat/url.c
index 7cd9e0c705..6956f6dc10 100644
--- a/libavformat/url.c
+++ b/libavformat/url.c
@@ -182,7 +182,7 @@  void ff_make_absolute_url(char *buf, int size, const char *base,
 
     /* Remove the file name from the base url */
     sep = strrchr(buf, '/');
-    if (sep <= root)
+    if (sep && sep <= root)
         sep = root;
 
     if (sep)