[FFmpeg-devel] [PATCH] Parse cookies more correctly

Michael Niedermayer michaelni at gmx.at
Mon Feb 10 15:15:01 CET 2014


On Fri, Feb 07, 2014 at 08:22:53PM -0800, Scott Moak wrote:
> Cookies with an Expires directive do not get parsed (and ignored)
> correctly, so we need to fix that.
> 
> Signed-off-by: Scott Moak <scott.moak at mybrainoncode.com>
> ---
>  libavformat/http.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 69c4d6d..794a68f 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -484,8 +484,10 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
>          char *param, *next_param, *cdomain = NULL, *cpath = NULL, *cvalue = NULL;
>          set_cookies = NULL;
>  
> -        while ((param = av_strtok(cookie, "; ", &next_param))) {
> +        while ((param = av_strtok(cookie, ";", &next_param))) {
>              cookie = NULL;
> +            /* skip leading spaces */
> +            param += strspn(param, " ");

the change to the seperators can introduce trailing spaces, they
probably should be removed too

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140210/61690fcf/attachment.asc>


More information about the ffmpeg-devel mailing list