talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 29ecadc1cb6d568b5a23e06d9256c0a714cb51a7
parent 63677adb68c57479f6bc7534cfbf2f234b1f4fb1
Author: Zhouyang <jiazhouyang09@gmail.com>
Date:   Fri,  4 Aug 2017 11:53:26 +0200

Fix bug #3857: Thanks to Zhouyang

Signed-off-by: Michael Rasmussen <mir@datanom.net>

Diffstat:
Msrc/plugins/clamd/libclamd/clamd-plugin.c | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c @@ -324,6 +324,10 @@ static int create_socket() { addr_i.sin_family = AF_INET; addr_i.sin_port = htons(Socket->socket.port); hp = gethostbyname(Socket->socket.host); + if (!hp) { + g_error("fail to get host by: %s", Socket->socket.host); + return new_sock; + } debug_print("IP socket host: %s:%d\n", Socket->socket.host, Socket->socket.port); bcopy((void *)hp->h_addr, (void *)&addr_i.sin_addr, hp->h_length);