bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH hurd 01/30] proc: fix NULL dereference


From: Justus Winter
Subject: [PATCH hurd 01/30] proc: fix NULL dereference
Date: Thu, 27 Nov 2014 14:18:41 +0100

This also restores the behavior before e9687ec4.

* proc/notify.c (do_mach_notify_dead_name): Fix NULL dereference.
---
 proc/notify.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/proc/notify.c b/proc/notify.c
index b6731ae..f179423 100644
--- a/proc/notify.c
+++ b/proc/notify.c
@@ -41,6 +41,9 @@ do_mach_notify_dead_name (struct port_info *pi,
 {
   struct proc *p;
 
+  if (! pi)
+    return EOPNOTSUPP;
+
   if (pi->port_right == generic_port)
     {
       check_dead_execdata_notify (deadport);
@@ -50,9 +53,7 @@ do_mach_notify_dead_name (struct port_info *pi,
 
   p = (struct proc *) pi;
 
-  if (!p
-      || p->p_pi.bucket != proc_bucket
-      || p->p_pi.class != proc_class)
+  if (p->p_pi.bucket != proc_bucket || p->p_pi.class != proc_class)
     return EOPNOTSUPP;
 
   if (p->p_task == deadport)
-- 
2.1.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]