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

Lukasz M lukasz.m.luki at gmail.com
Wed Feb 12 17:38:40 CET 2014


On 12 February 2014 07:57, Scott Moak <scott.moak at mybrainoncode.com> 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);
> +        }
> +


How it is supposed to work?  I don't understand tbh.
You also don't need to use av_strlcpy to remove trailing spaces, they may
be overwritten with 0.


More information about the ffmpeg-devel mailing list