[FFmpeg-devel] [PATCH 2/2] Strip trailing spaces from cookies

Michael Niedermayer michaelni at gmx.at
Wed Feb 12 17:16:50 CET 2014


On Tue, Feb 11, 2014 at 10:57:06PM -0800, Scott Moak wrote:
> Signed-off-by: Scott Moak <scott.moak at mybrainoncode.com>
> ---
>  libavformat/http.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavformat/http.c b/libavformat/http.c
> index 794a68f..14382e0 100644
> --- a/libavformat/http.c
> +++ b/libavformat/http.c
> @@ -484,6 +484,11 @@ static int get_cookies(HTTPContext *s, char **cookies, const char *path,
>          char *param, *next_param, *cdomain = NULL, *cpath = NULL, *cvalue = NULL;
>          set_cookies = NULL;
>  
> +        /* skip trailing spaces */
> +        if (av_strncasecmp(" ", cookie, strlen(cookie) - 1)) {
> +            av_strlcpy(cookie, cookie, strlen(cookie) - 1);
> +        }

this does not look sufficient
when you tokenize on ; there can be trailing whilespace on each
token

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
-------------- 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/20140212/e256ecec/attachment.asc>


More information about the ffmpeg-devel mailing list