projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
63677ad
)
Fix bug #3857: Thanks to Zhouyang
author
Zhouyang
<jiazhouyang09@gmail.com>
Fri, 4 Aug 2017 09:53:26 +0000
(11:53 +0200)
committer
Michael Rasmussen
<mir@datanom.net>
Fri, 4 Aug 2017 09:53:26 +0000
(11:53 +0200)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
src/plugins/clamd/libclamd/clamd-plugin.c
patch
|
blob
|
history
diff --git
a/src/plugins/clamd/libclamd/clamd-plugin.c
b/src/plugins/clamd/libclamd/clamd-plugin.c
index c72de83cc60e2a99f5aa123a04dfb942ac66e5c3..6f1cc59e5aecfff3ddf0effbcb0021f596f21ef5 100644
(file)
--- 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);