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
This commit is contained in:
Marcel Moolenaar 1999-09-29 20:12:39 +00:00
parent 535b692091
commit 16df98ecc6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51799
3 changed files with 24 additions and 12 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}