From d0a7ee3f613b0c3f2370c6cc81e5aafef67120f0 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 27 Sep 2019 09:41:43 +0200 Subject: cookies: using a share with cookies shouldn't enable the cookie engine The 'share object' only sets the storage area for cookies. The "cookie engine" still needs to be enabled or activated using the normal cookie options. This caused the curl command line tool to accidentally use cookies without having been told to, since curl switched to using shared cookies in 7.66.0. Test 1166 verifies Updated test 506 Fixes #4429 Closes #4434 --- lib/cookie.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/cookie.c') diff --git a/lib/cookie.c b/lib/cookie.c index 0e71129de..f6b52df2f 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -1090,6 +1090,8 @@ Curl_cookie_add(struct Curl_easy *data, * * If 'newsession' is TRUE, discard all "session cookies" on read from file. * + * Note that 'data' might be called as NULL pointer. + * * Returns NULL on out of memory. Invalid cookies are ignored. ****************************************************************************/ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, @@ -1160,6 +1162,8 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data, } c->running = TRUE; /* now, we're running */ + if(data) + data->state.cookie_engine = TRUE; return c; -- cgit v1.2.3