[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 172/282: Curl_is_ASCII_name: handle a NULL argument
From: |
gnunet |
Subject: |
[gnurl] 172/282: Curl_is_ASCII_name: handle a NULL argument |
Date: |
Wed, 01 Apr 2020 14:30:37 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 1d1e9e8ad7a5f35818dc7072e6fbe8a76a93e018
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Feb 27 11:06:14 2020 +0100
Curl_is_ASCII_name: handle a NULL argument
Make the function tolerate a NULL pointer input to avoid dereferencing
that pointer.
Follow-up to efce3ea5a85126d
Detected by OSS-Fuzz
Reviewed-By: Steve Holme
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20907
Fixes #4985
Closes #4986
---
lib/smtp.c | 2 --
lib/url.c | 4 ++++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/smtp.c b/lib/smtp.c
index a87e6126a..79499e6d4 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -1773,8 +1773,6 @@ static CURLcode smtp_parse_address(struct connectdata
*conn, const char *fqma,
and send the host name using UTF-8 rather than as 7-bit ACE (which is
our preference) */
}
- else
- host->name = NULL;
/* Extract the local address from the mailbox */
*address = dup;
diff --git a/lib/url.c b/lib/url.c
index 85cdd5336..47fc66aed 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1438,8 +1438,12 @@ void Curl_verboseconnect(struct connectdata *conn)
*/
bool Curl_is_ASCII_name(const char *hostname)
{
+ /* get an UNSIGNED local version of the pointer */
const unsigned char *ch = (const unsigned char *)hostname;
+ if(!hostname) /* bad input, consider it ASCII! */
+ return TRUE;
+
while(*ch) {
if(*ch++ & 0x80)
return FALSE;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 149/282: tests: Added a unit test for MD4 digest generation, (continued)
- [gnurl] 149/282: tests: Added a unit test for MD4 digest generation, gnunet, 2020/04/01
- [gnurl] 163/282: smtp: Support the SMTPUTF8 extension for the EXPN command, gnunet, 2020/04/01
- [gnurl] 162/282: smtp: Support the SMTPUTF8 extension in the VRFY command, gnunet, 2020/04/01
- [gnurl] 164/282: smtp: Tidy up, following recent changes, to maintain the coding style, gnunet, 2020/04/01
- [gnurl] 156/282: smtp: Support UTF-8 based host names in the MAIL command, gnunet, 2020/04/01
- [gnurl] 161/282: smtp: Support the SMTPUTF8 extension in the RCPT TO command, gnunet, 2020/04/01
- [gnurl] 157/282: smtp: Support UTF-8 based host names in the RCPT TO command, gnunet, 2020/04/01
- [gnurl] 165/282: http: added 417 response treatment, gnunet, 2020/04/01
- [gnurl] 166/282: cookie: remove unnecessary check for 'out != 0', gnunet, 2020/04/01
- [gnurl] 160/282: smtp: Support the SMTPUTF8 extension in the MAIL command, gnunet, 2020/04/01
- [gnurl] 172/282: Curl_is_ASCII_name: handle a NULL argument,
gnunet <=
- [gnurl] 169/282: libssh: improve known hosts handling, gnunet, 2020/04/01
- [gnurl] 174/282: gtls: Fixed compilation when using GnuTLS < 3.5.0, gnunet, 2020/04/01
- [gnurl] 173/282: RELEASE-NOTES: Corrected the link to issue #4892, gnunet, 2020/04/01
- [gnurl] 176/282: runtests: restore the command log, gnunet, 2020/04/01
- [gnurl] 154/282: smtp: Added UTF-8 mailbox tests to verify existing behaviour, gnunet, 2020/04/01
- [gnurl] 167/282: test1323: Added the missing 'unit test' feature requirement in the test case, gnunet, 2020/04/01
- [gnurl] 177/282: tests: fix Python 3 compatibility of smbserver.py, gnunet, 2020/04/01
- [gnurl] 171/282: RELEASE-NOTES: synced, gnunet, 2020/04/01
- [gnurl] 175/282: smtp: fix memory leak on exit path, gnunet, 2020/04/01
- [gnurl] 183/282: TODO: curl --proxycommand, gnunet, 2020/04/01