[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 93/222: url: fix the NULL hostname compiler warning case
From: |
gnunet |
Subject: |
[gnurl] 93/222: url: fix the NULL hostname compiler warning case |
Date: |
Thu, 07 Nov 2019 00:09:49 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit af3ced3b9ceb529da34a3d9fe8193ee01465ee9b
Author: Jay Satiro <address@hidden>
AuthorDate: Wed Sep 25 14:35:02 2019 +0200
url: fix the NULL hostname compiler warning case
Closes #4403
---
lib/url.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/lib/url.c b/lib/url.c
index e4c47930a..14e6e2625 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1870,11 +1870,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy
*data,
(void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0);
hostname = data->state.up.hostname;
- if(!hostname)
- /* this is for file:// transfers, get a dummy made */
- hostname = (char *)"";
-
- if(hostname[0] == '[') {
+ if(hostname && hostname[0] == '[') {
/* This looks like an IPv6 address literal. See if there is an address
scope. */
size_t hlen;
@@ -1888,7 +1884,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy
*data,
}
/* make sure the connect struct gets its own copy of the host name */
- conn->host.rawalloc = strdup(hostname);
+ conn->host.rawalloc = strdup(hostname ? hostname : "");
if(!conn->host.rawalloc)
return CURLE_OUT_OF_MEMORY;
conn->host.name = conn->host.rawalloc;
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 90/222: altsvc: save h3 as h3-23, (continued)
- [gnurl] 90/222: altsvc: save h3 as h3-23, gnunet, 2019/11/06
- [gnurl] 102/222: quiche: set 'drain' when returning without having drained the queues, gnunet, 2019/11/06
- [gnurl] 92/222: travis: move the go install to linux-only, gnunet, 2019/11/06
- [gnurl] 100/222: HTTP3: merged and simplified the two 'running' sections, gnunet, 2019/11/06
- [gnurl] 87/222: os400: getpeername() and getsockname() return ebcdic AF_UNIX sockaddr,, gnunet, 2019/11/06
- [gnurl] 91/222: altsvc: correct the #ifdef for the ngtcp2 backend, gnunet, 2019/11/06
- [gnurl] 94/222: ngtcp2: remove fprintf() calls, gnunet, 2019/11/06
- [gnurl] 88/222: HTTP3.md: move -p for mkdir, remove -j for make, gnunet, 2019/11/06
- [gnurl] 108/222: FTP: url-decode path before evaluation, gnunet, 2019/11/06
- [gnurl] 89/222: urlapi: question mark within fragment is still fragment, gnunet, 2019/11/06
- [gnurl] 93/222: url: fix the NULL hostname compiler warning case,
gnunet <=
- [gnurl] 97/222: openssl: use strerror on SSL_ERROR_SYSCALL, gnunet, 2019/11/06
- [gnurl] 109/222: FTP: add test for FTPFILE_NOCWD: Avoid redundant CWDs, gnunet, 2019/11/06
- [gnurl] 127/222: chunked-encoding: stop hiding the CURLE_BAD_CONTENT_ENCODING error, gnunet, 2019/11/06
- [gnurl] 95/222: url: don't set appconnect time for non-ssl/non-ssh connections, gnunet, 2019/11/06
- [gnurl] 121/222: git: add tests/server/disabled to .gitignore, gnunet, 2019/11/06
- [gnurl] 122/222: AppVeyor: remove MSYS2_ARG_CONV_EXCL for winbuild, gnunet, 2019/11/06
- [gnurl] 125/222: urlapi: fix unused variable warning, gnunet, 2019/11/06
- [gnurl] 123/222: AppVeyor: add 32-bit MinGW-w64 build, gnunet, 2019/11/06
- [gnurl] 130/222: tool_operate: rename functions to make more sense, gnunet, 2019/11/06
- [gnurl] 129/222: curl: create easy handles on-demand and not ahead of time, gnunet, 2019/11/06