From a77102446a7ed62892f4629f29c32047c3d43b72 Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 29 Sep 1999 20:12:39 +0000 Subject: Careless use of struct proc *p caused major problems. 'p' is allowed to be NULL in this function (nfs_sigintr). Reorder the statements and guard them all with a single if (p != NULL). reported, reviewed and tested by: jdp --- sys/nfs/nfs_socket.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'sys/nfs') diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 9434fb9..f7204b5 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -1504,15 +1504,19 @@ nfs_sigintr(nmp, rep, p) { sigset_t tmpset; - tmpset = p->p_siglist; - SIGSETNAND(tmpset, p->p_sigmask); - SIGSETNAND(tmpset, p->p_sigignore); if (rep && (rep->r_flags & R_SOFTTERM)) return (EINTR); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); - if (p && SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) + if (p == NULL) + return (0); + + tmpset = p->p_siglist; + SIGSETNAND(tmpset, p->p_sigmask); + SIGSETNAND(tmpset, p->p_sigignore); + if (SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) return (EINTR); + return (0); } -- cgit v1.1