From: mvs Date: Sat, 23 Oct 2021 20:44:42 +0000 (+0000) Subject: sonewconn() returns the pointer to 'socket' struct so check it against X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1a703092d71b5971a28f8c256a5182b080975f69;p=openbsd sonewconn() returns the pointer to 'socket' struct so check it against NULL instead of '0'. ok deraadt@ --- diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 8a8882118b6..c85b72e80d3 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.150 2021/10/21 22:11:07 mvs Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.151 2021/10/23 20:44:42 mvs Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -660,7 +660,7 @@ unp_connect(struct socket *so, struct mbuf *nam, struct proc *p) } if (so->so_proto->pr_flags & PR_CONNREQUIRED) { if ((so2->so_options & SO_ACCEPTCONN) == 0 || - (so3 = sonewconn(so2, 0)) == 0) { + (so3 = sonewconn(so2, 0)) == NULL) { error = ECONNREFUSED; goto put_locked; }