From d6767b4ed64fe2a7b5f4e00181035a34e68f90c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 20 Aug 2016 19:55:35 +0200 Subject: [PATCH] api: fix crash in function network_connect_to() if address is NULL (issue #781) --- ChangeLog.adoc | 1 + src/core/wee-network.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 254ab3822..fb547bdfd 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -36,6 +36,7 @@ Improvements:: Bug fixes:: * core, irc, xfer: refresh domain name and name server addresses before connection to servers (issue #771) + * api: fix crash in function network_connect_to() if address is NULL * api: fix connection to servers with hook_connect() on Windows 10 with Windows subsystem for Linux (issue #770) * api: fix crash in function string_split_command() when the separator is not a semicolon (issue #731) * irc: fix NULL pointer dereference in 734 command callback (issue #738) diff --git a/src/core/wee-network.c b/src/core/wee-network.c index b61d18faf..44dcea4d6 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -674,6 +674,9 @@ network_connect_to (const char *proxy, struct sockaddr *address, sock = -1; proxy_addrinfo = NULL; + if (!address || (address_length == 0)) + return -1; + ptr_proxy = NULL; if (proxy && proxy[0]) {