curl/lib
Daniel Gustafsson a6cdfd24ee cookies: Improve errorhandling for reading cookiefile
The existing programming had some issues with errorhandling for reading
the cookie file. If the file failed to open, we would silently ignore it
and continue as if there was no file (or stdin) passed. In this case, we
would also call fclose() on the NULL FILE pointer, which is undefined
behavior. Fix by ensuring that the FILE pointer is set before calling
fclose on it, and issue a warning in case the file cannot be opened.
Erroring out on nonexisting file would break backwards compatibility of
very old behavior so we can't really go there.

Closes: #8699
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
2022-04-20 14:17:29 +02:00
..
vauth lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
vquic lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
vssh libssh: fix double close 2022-04-20 09:12:36 +02:00
vtls timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
.checksrc
.gitattributes
.gitignore
altsvc.c msh3: add support for QUIC and HTTP/3 using msh3 2022-04-10 18:23:04 +02:00
altsvc.h
amigaos.c
amigaos.h
arpa_telnet.h
asyn-ares.c timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
asyn-thread.c
asyn.h
base64.c
bufref.c
bufref.h
c-hyper.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
c-hyper.h
CMakeLists.txt
config-amigaos.h
config-dos.h
config-mac.h
config-os400.h msh3: add support for QUIC and HTTP/3 using msh3 2022-04-10 18:23:04 +02:00
config-plan9.h
config-riscos.h
config-win32.h
config-win32ce.h
conncache.c connecache: remove duplicate connc->closure_handle check 2022-04-06 08:32:04 +02:00
conncache.h
connect.c connect: make Curl_getconnectinfo work with conn cache from share handle 2022-03-08 09:22:09 +01:00
connect.h
content_encoding.c
content_encoding.h
cookie.c cookies: Improve errorhandling for reading cookiefile 2022-04-20 14:17:29 +02:00
cookie.h
curl_addrinfo.c
curl_addrinfo.h
curl_base64.h
curl_config.h.cmake msh3: add support for QUIC and HTTP/3 using msh3 2022-04-10 18:23:04 +02:00
curl_ctype.c
curl_ctype.h
curl_des.c misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
curl_des.h misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
curl_endian.c
curl_endian.h
curl_fnmatch.c
curl_fnmatch.h
curl_get_line.c
curl_get_line.h
curl_gethostname.c
curl_gethostname.h
curl_gssapi.c infof: consistent capitalization of warning messages 2022-04-14 21:13:29 +02:00
curl_gssapi.h
curl_hmac.h
curl_krb5.h
curl_ldap.h
curl_md4.h
curl_md5.h
curl_memory.h
curl_memrchr.c
curl_memrchr.h
curl_multibyte.c lib: fix some misuse of curlx_convert_wchar_to_UTF8 2022-03-18 03:20:03 -04:00
curl_multibyte.h
curl_ntlm_core.c ntlm: remove unused feature defines 2022-02-15 14:12:41 +01:00
curl_ntlm_core.h ntlm: remove unused feature defines 2022-02-15 14:12:41 +01:00
curl_ntlm_wb.c
curl_ntlm_wb.h
curl_path.c
curl_path.h
curl_printf.h
curl_range.c
curl_range.h
curl_rtmp.c
curl_rtmp.h
curl_sasl.c English: use American spelling consistently 2022-04-05 14:55:47 +02:00
curl_sasl.h urldata: remove conn->bits.user_passwd 2022-02-16 10:28:31 +01:00
curl_setup_once.h
curl_setup.h msh3: add support for QUIC and HTTP/3 using msh3 2022-04-10 18:23:04 +02:00
curl_sha256.h
curl_sspi.c
curl_sspi.h
curl_threads.c
curl_threads.h
curlx.h
dict.c urldata: remove conn->bits.user_passwd 2022-02-16 10:28:31 +01:00
dict.h
doh.c lib: #ifdef on USE_HTTP2 better 2022-04-01 13:45:52 +02:00
doh.h
dotdot.c
dotdot.h
dynbuf.c
dynbuf.h
easy.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
easygetopt.c
easyif.h
easyoptions.c
easyoptions.h
escape.c
escape.h
file.c
file.h
fileinfo.c
fileinfo.h
formdata.c
formdata.h
ftp.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
ftp.h
ftplistparser.c
ftplistparser.h
getenv.c
getinfo.c
getinfo.h
gopher.c
gopher.h
h2h3.c misc: spelling fixes 2022-03-30 10:49:06 +02:00
h2h3.h h2h3: fix compiler warning due to function prototype mismatch 2022-02-14 16:45:14 -05:00
hash.c
hash.h
headers.c misc: spelling fixes 2022-03-30 10:49:06 +02:00
headers.h headers.h: make Curl_headers_push() be CURLE_OK when not built 2022-03-24 00:52:34 +01:00
hmac.c English: use American spelling consistently 2022-04-05 14:55:47 +02:00
hostasyn.c
hostip4.c
hostip6.c
hostip.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
hostip.h
hostsyn.c
hsts.c
hsts.h
http2.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
http2.h
http_aws_sigv4.c misc: remove strlen for Curl_checkheaders + Curl_checkProxyheaders 2022-02-10 08:51:06 +01:00
http_aws_sigv4.h
http_chunks.c header api: add curl_easy_header and curl_easy_nextheader 2022-03-22 08:24:22 +01:00
http_chunks.h
http_digest.c
http_digest.h
http_negotiate.c
http_negotiate.h
http_ntlm.c
http_ntlm.h
http_proxy.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
http_proxy.h header api: add curl_easy_header and curl_easy_nextheader 2022-03-22 08:24:22 +01:00
http.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
http.h msh3: add support for QUIC and HTTP/3 using msh3 2022-04-10 18:23:04 +02:00
idn_win32.c lib: fix some misuse of curlx_convert_wchar_to_UTF8 2022-03-18 03:20:03 -04:00
if2ip.c misc: remove unused data when IPv6 is not supported 2022-02-13 12:08:50 +01:00
if2ip.h misc: remove unused data when IPv6 is not supported 2022-02-13 12:08:50 +01:00
imap.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
imap.h
inet_ntop.c
inet_ntop.h
inet_pton.c
inet_pton.h
krb5.c
ldap.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
libcurl.plist
libcurl.rc
libcurl.vers.in
llist.c
llist.h
Makefile.am scripts: move three scripts from lib/ to scripts/ 2022-03-23 15:26:11 +01:00
makefile.amiga
makefile.dj
Makefile.inc timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
Makefile.m32
md4.c
md5.c
memdebug.c
memdebug.h
mime.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
mime.h mime: use a define instead of the magic number 24 2022-02-13 11:46:18 +01:00
mprintf.c mprintf: remove strlen calls on empty strings in dprintf_formatf 2022-02-11 23:07:34 +01:00
mqtt.c mqtt: better handling of TCP disconnect mid-message 2022-03-29 08:43:14 +02:00
mqtt.h
multi.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
multihandle.h
multiif.h
netrc.c
netrc.h
nonblock.c nonblock: restore setsockopt method to curlx_nonblock 2022-03-09 09:13:42 +01:00
nonblock.h
openldap.c urldata: remove conn->bits.user_passwd 2022-02-16 10:28:31 +01:00
optiontable.pl
parsedate.c
parsedate.h
pingpong.c pop3/smtp: return *WEIRD_SERVER_REPLY when not understood 2022-03-29 14:01:53 +02:00
pingpong.h
pop3.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
pop3.h
progress.c
progress.h
psl.c
psl.h
quic.h msh3: add support for QUIC and HTTP/3 using msh3 2022-04-10 18:23:04 +02:00
rand.c infof: consistent capitalization of warning messages 2022-04-14 21:13:29 +02:00
rand.h
rename.c
rename.h
rtsp.c rtsp: don't let CSeq error override earlier errors 2022-03-18 03:24:37 -04:00
rtsp.h
select.c timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
select.h
sendf.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
sendf.h header api: add curl_easy_header and curl_easy_nextheader 2022-03-22 08:24:22 +01:00
setopt.c English: use American spelling consistently 2022-04-05 14:55:47 +02:00
setopt.h
setup-os400.h
setup-vms.h
setup-win32.h
sha256.c sha256: Fix minimum OpenSSL version 2022-02-17 00:35:23 -05:00
share.c
share.h
sigpipe.h
slist.c
slist.h
smb.c urldata: remove conn->bits.user_passwd 2022-02-16 10:28:31 +01:00
smb.h
smtp.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
smtp.h
sockaddr.h
socketpair.c
socketpair.h
socks_gssapi.c
socks_sspi.c
socks.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
socks.h English: use American spelling consistently 2022-04-05 14:55:47 +02:00
speedcheck.c
speedcheck.h
splay.c
splay.h
strcase.c
strcase.h strcase.h: add comment about the return code 2022-03-31 11:35:27 +02:00
strdup.c
strdup.h
strerror.c
strerror.h
strtok.c
strtok.h
strtoofft.c
strtoofft.h
system_win32.c
system_win32.h
telnet.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
telnet.h
tftp.c checkprefix: remove strlen calls 2022-02-21 08:18:59 +01:00
tftp.h
timediff.c timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
timediff.h timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
timeval.c
timeval.h timediff.[ch]: add curlx helper functions for timeval conversions 2022-04-17 13:11:27 +02:00
transfer.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
transfer.h misc: remove strlen for Curl_checkheaders + Curl_checkProxyheaders 2022-02-10 08:51:06 +01:00
url.c lib: remove exclamation marks 2022-04-16 11:55:05 +02:00
url.h
urlapi-int.h
urlapi.c misc: spelling fixes 2022-03-30 10:49:06 +02:00
urldata.h English: use American spelling consistently 2022-04-05 14:55:47 +02:00
version_win32.c misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
version_win32.h
version.c
warnless.c lib/warnless.[ch]: only check for WIN32 and ignore _WIN32 2022-03-23 05:00:10 +01:00
warnless.h lib/warnless.[ch]: only check for WIN32 and ignore _WIN32 2022-03-23 05:00:10 +01:00
wildcard.c
wildcard.h