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

Scott Moak scott.moak at mybrainoncode.com
Wed Feb 12 07:57:06 CET 2014


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);
+        }
+
         while ((param = av_strtok(cookie, ";", &next_param))) {
             cookie = NULL;
             /* skip leading spaces */
-- 
1.8.5.4



More information about the ffmpeg-devel mailing list