From 2685041a5c285968696de639699fb39a0fdf8c69 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 1 Apr 2015 23:25:29 +0200 Subject: cookie: handle spaces after the name in Set-Cookie "name =value" is fine and the space should just be skipped. Updated test 31 to also test for this. Bug: https://github.com/bagder/curl/issues/195 Reported-by: cromestant Help-by: Frank Gevaerts --- lib/cookie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/cookie.c') diff --git a/lib/cookie.c b/lib/cookie.c index f1450e905..0864f6bcf 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -407,7 +407,7 @@ Curl_cookie_add(struct SessionHandle *data, do { /* we have a = pair or a stand-alone word here */ name[0]=what[0]=0; /* init the buffers */ - if(1 <= sscanf(ptr, "%" MAX_NAME_TXT "[^;\r\n =]=%" + if(1 <= sscanf(ptr, "%" MAX_NAME_TXT "[^;\r\n =] =%" MAX_COOKIE_LINE_TXT "[^;\r\n]", name, what)) { /* Use strstore() below to properly deal with received cookie -- cgit v1.2.3