summaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2023-07-15 09:47:18 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2023-07-15 09:47:18 +0200
commiteac2a2cc668f491c7d265c5fe6c50f51a60c6256 (patch)
tree87a5f5c9f173123465a6d7ad42a493b070f71348 /src/socket.c
parent1842e4ff88f93490966398ae9b763f6dba069799 (diff)
parent163bc6d7fc268bdb1c7cc03699f69d0c5cc0b4cd (diff)
Update upstream source from tag 'upstream/4.14'
Update to upstream version '4.14' with Debian dir 714f602a4a45e9e83780cc1f0ad69803d12fe0e6
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c
index 9b5d78a..0b6f674 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -86,8 +86,11 @@ int HX_addrport_split(const char *spec, char *host,
unsigned long hlen = end - spec;
if (hlen >= hbufsz)
return -E2BIG;
- if (*++end == '\0')
+ if (*++end == '\0') {
+ memmove(host, spec, hlen);
+ host[hlen] = '\0';
return 1;
+ }
if (*end++ != ':')
return -EINVAL;
char *nend = nullptr;
@@ -146,6 +149,8 @@ int HX_inet_connect(const char *host, uint16_t port, unsigned int oflags)
struct addrinfo *aires = nullptr;
int ret = HX_inet_lookup(host, port, AI_ADDRCONFIG, &aires);
int saved_errno = 0;
+ if (ret != 0)
+ ;
for (const struct addrinfo *r = aires; r != nullptr; r = r->ai_next) {
int fd = socket(r->ai_family, r->ai_socktype, r->ai_protocol);
if (fd < 0) {