summaryrefslogtreecommitdiff
path: root/proc/notify.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-27 01:24:43 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-27 01:25:39 +0100
commitb69b9c28b6628c7d736476d075d56ae137afd343 (patch)
tree15cb53f192c7e6d091f03841a7552c780ccb7e68 /proc/notify.c
parent9cd99ff80c3c129ed137e0d22b7e438f292e5e8f (diff)
Fix proc crashes
* proc/notify.c (do_mach_notify_dead_name): When `pi' is NULL, immediately return EOPNOTSUPP.
Diffstat (limited to 'proc/notify.c')
-rw-r--r--proc/notify.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/proc/notify.c b/proc/notify.c
index b6731ae5..c5734b09 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,8 +53,7 @@ do_mach_notify_dead_name (struct port_info *pi,
p = (struct proc *) pi;
- if (!p
- || p->p_pi.bucket != proc_bucket
+ if (p->p_pi.bucket != proc_bucket
|| p->p_pi.class != proc_class)
return EOPNOTSUPP;