nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
f42f558
)
Merge: Add error instead of segfault on gethostbyname fail
author
Jean Privat
<jean@pryen.org>
Mon, 30 Nov 2015 15:09:05 +0000
(10:09 -0500)
committer
Jean Privat
<jean@pryen.org>
Mon, 30 Nov 2015 15:09:05 +0000
(10:09 -0500)
Signed-off-by: Philippe Pepos Petitclerc <ppeposp@gmail.com>
Pull-Request: #1857
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Reviewed-by: Jean Privat <jean@pryen.org>
lib/libevent.nit
patch
|
blob
|
history
diff --git
a/lib/libevent.nit
b/lib/libevent.nit
index
9cbe38e
..
c01d417
100644
(file)
--- a/
lib/libevent.nit
+++ b/
lib/libevent.nit
@@
-346,6
+346,10
@@
extern class ConnectionListener `{ struct evconnlistener * `}
struct hostent *hostent = gethostbyname(address);
+ if (!hostent) {
+ return NULL;
+ }
+
memset(&sin, 0, sizeof(sin));
sin.sin_family = hostent->h_addrtype;
sin.sin_port = htons(port);