mirror of
https://github.com/curl/curl.git
synced 2026-07-16 08:37:18 +03:00
cookies: fix NULL dereference if flushing cookies with no CookieInfo set
Regression brought by a52e46f390 (shipped in 7.63.0)
Closes #3613
This commit is contained in:
parent
8a1948283a
commit
8eddb8f425
1 changed files with 3 additions and 2 deletions
|
|
@ -1542,7 +1542,8 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
|
||||||
struct Cookie **array;
|
struct Cookie **array;
|
||||||
|
|
||||||
/* at first, remove expired cookies */
|
/* at first, remove expired cookies */
|
||||||
remove_expired(c);
|
if(c)
|
||||||
|
remove_expired(c);
|
||||||
|
|
||||||
if(!strcmp("-", dumphere)) {
|
if(!strcmp("-", dumphere)) {
|
||||||
/* use stdout */
|
/* use stdout */
|
||||||
|
|
@ -1561,7 +1562,7 @@ static int cookie_output(struct CookieInfo *c, const char *dumphere)
|
||||||
"# This file was generated by libcurl! Edit at your own risk.\n\n",
|
"# This file was generated by libcurl! Edit at your own risk.\n\n",
|
||||||
out);
|
out);
|
||||||
|
|
||||||
if(c->numcookies) {
|
if(c && c->numcookies) {
|
||||||
array = malloc(sizeof(struct Cookie *) * c->numcookies);
|
array = malloc(sizeof(struct Cookie *) * c->numcookies);
|
||||||
if(!array) {
|
if(!array) {
|
||||||
if(!use_stdout)
|
if(!use_stdout)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue