Repositories
/
ecl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
237af2e
)
getprotobyname() may return NULL, causing segfaults in this function.
author
Philipp Marek
<philipp@marek.priv.at>
Sat, 22 Feb 2014 10:00:53 +0000
(11:00 +0100)
committer
Philipp Marek
<philipp@marek.priv.at>
Sat, 22 Feb 2014 10:00:53 +0000
(11:00 +0100)
contrib/sockets/sockets.lisp
patch
|
blob
|
blame
|
history
diff --git
a/contrib/sockets/sockets.lisp
b/contrib/sockets/sockets.lisp
index
fa05413
..
9c360d5
100755
(executable)
--- a/
contrib/sockets/sockets.lisp
+++ b/
contrib/sockets/sockets.lisp
@@
-517,9
+517,15
@@
safe_buffer_pointer(cl_object x, cl_index size)
(defun get-protocol-by-name (string-or-symbol)
"Calls getprotobyname"
(let ((string (string string-or-symbol)))
- (c-inline (string) (:cstring) :int
- "getprotobyname(#0)->p_proto"
- :one-liner t)))
+ (c-inline (string) (:cstring) :int
+ "{
+ struct protoent *pe;
+
+ pe = getprotobyname(#0);
+ @(return 0) = pe ? pe->p_proto : -1;
+ }
+ ")))
+
(defun make-inet-address (dotted-quads)
"Return a vector of octets given a string DOTTED-QUADS in the format