diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2018-03-04 14:54:59 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-04 14:54:59 +0000 |
commit | 4f2be7d71edba728917523ad1c5f9f5b90529106 (patch) | |
tree | b0201f1c383c856f6ac538b6e4d384e172fbcb92 /url.c | |
parent | Update ChangeLog (diff) | |
parent | Add error handling code for fopen (diff) | |
download | w3m-4f2be7d71edba728917523ad1c5f9f5b90529106.tar.gz w3m-4f2be7d71edba728917523ad1c5f9f5b90529106.zip |
Merge pull request #96 from ZhouyangJia/master
Fix crashes when some external APIs fail
Diffstat (limited to '')
-rw-r--r-- | url.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1752,6 +1752,8 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, write(sock, tmp->ptr, tmp->length); if(w3m_reqlog){ FILE *ff = fopen(w3m_reqlog, "a"); + if (ff == NULL) + return uf; if (sslh) fputs("HTTPS: request via SSL\n", ff); else @@ -1774,6 +1776,8 @@ openURL(char *url, ParsedURL *pu, ParsedURL *current, write(sock, tmp->ptr, tmp->length); if(w3m_reqlog){ FILE *ff = fopen(w3m_reqlog, "a"); + if (ff == NULL) + return uf; fwrite(tmp->ptr, sizeof(char), tmp->length, ff); fclose(ff); } |