mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-04-21 01:00:38 -07:00
getprotobyname() may return NULL, causing segfaults in this function.
This commit is contained in:
parent
237af2e803
commit
50ba000738
1 changed files with 9 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue