diff mbox series

[FFmpeg-devel] libavformat/http.c: cookie path attribute should be optional not compulsory

Message ID 9F880AE4-B819-4FBB-B086-54DD9984D80D@gmail.com
State Accepted
Commit 6f1c00695973b48d5cb7ed574577634634f8a084
Headers show
Series [FFmpeg-devel] libavformat/http.c: cookie path attribute should be optional not compulsory | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael J. Walsh March 3, 2023, 4:24 p.m. UTC
The path attribute in the Set-Cookie header is optional but treated by ffmpeg as being compulsory.

Signed-off-by: Michael J. Walsh <mjfwalsh@gmail.com>
—--
 libavformat/http.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marton Balint March 8, 2023, 10:45 p.m. UTC | #1
On Fri, 3 Mar 2023, Michael J. Walsh wrote:

> The path attribute in the Set-Cookie header is optional but treated by ffmpeg as being compulsory.
>
> Signed-off-by: Michael J. Walsh <mjfwalsh@gmail.com>
> —--
> libavformat/http.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks, will apply.

Regards,
Marton

>
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 7bce821535..dde22a7e09 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -1293,9 +1293,9 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
>                 goto skip_cookie;
>         }
> 
> -        // ensure this cookie matches the path
> +        // if a cookie path is provided, ensure the request path is within that path
>         e = av_dict_get(cookie_params, "path", NULL, 0);
> -        if (!e || av_strncasecmp(path, e->value, strlen(e->value)))
> +        if (e && av_strncasecmp(path, e->value, strlen(e->value)))
>             goto skip_cookie;
>
>         // cookie parameters match, so copy the value
> -- 
> 2.30.2
>
>
> _______________________________________________
> 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".
diff mbox series

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 7bce821535..dde22a7e09 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1293,9 +1293,9 @@  static int get_cookies(HTTPContext *s, char **cookies, const char *path,
                 goto skip_cookie;
         }
 
-        // ensure this cookie matches the path
+        // if a cookie path is provided, ensure the request path is within that path
         e = av_dict_get(cookie_params, "path", NULL, 0);
-        if (!e || av_strncasecmp(path, e->value, strlen(e->value)))
+        if (e && av_strncasecmp(path, e->value, strlen(e->value)))
             goto skip_cookie;
 
         // cookie parameters match, so copy the value