summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-01-19 12:39:00 +0000
committerbde <bde@FreeBSD.org>1998-01-19 12:39:00 +0000
commit421158c94f47608d01fa044da1e014dbad7e436e (patch)
treed1c4dfc9021b3d2bcd9702967c627775517f7c3e /sys/kern/kern_resource.c
parentdc87409fdea28bc7d0aff0652bd75b07acc1cd47 (diff)
downloadFreeBSD-src-421158c94f47608d01fa044da1e014dbad7e436e.zip
FreeBSD-src-421158c94f47608d01fa044da1e014dbad7e436e.tar.gz
Set p_retval for the correct process in getpriority(). This fixes
a null pointer panic when the pointer for the incorrect process is NULL. getpriority() was broken in rev.1.27. Rev.1.28 broke the warning instead of fixing the problem. PR: 5495
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 12722dd..5210a0e 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_resource.c 8.5 (Berkeley) 1/21/94
- * $Id: kern_resource.c,v 1.28 1997/11/07 08:52:57 phk Exp $
+ * $Id: kern_resource.c,v 1.29 1997/12/16 17:40:17 eivind Exp $
*/
#include "opt_compat.h"
@@ -76,7 +76,7 @@ getpriority(curp, uap)
struct proc *curp;
register struct getpriority_args *uap;
{
- register struct proc *p = 0;
+ register struct proc *p;
register int low = PRIO_MAX + 1;
switch (uap->which) {
@@ -120,7 +120,7 @@ getpriority(curp, uap)
}
if (low == PRIO_MAX + 1)
return (ESRCH);
- p->p_retval[0] = low;
+ curp->p_retval[0] = low;
return (0);
}
OpenPOWER on IntegriCloud