From 0a56227766bfc7ee00a3d983e594ab81fc82b72a Mon Sep 17 00:00:00 2001 From: Carl Fredrik Hammar Date: Sun, 1 Jul 2012 22:18:12 +0200 Subject: Check for null ports in auth server * auth/auth.c (S_auth_user_authenticate, S_auth_server_authenticate): Fail with EINVAL if RENDEZVOUS is MACH_PORT_NULL. --- auth/auth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'auth/auth.c') diff --git a/auth/auth.c b/auth/auth.c index 11db0f8f..ec738ce2 100644 --- a/auth/auth.c +++ b/auth/auth.c @@ -305,7 +305,7 @@ S_auth_user_authenticate (struct authhandle *userauth, if (! userauth) return EOPNOTSUPP; - if (rendezvous == MACH_PORT_DEAD) /* Port died in transit. */ + if (rendezvous == MACH_PORT_NULL || rendezvous == MACH_PORT_DEAD) return EINVAL; u.user = userauth; @@ -382,7 +382,7 @@ S_auth_server_authenticate (struct authhandle *serverauth, if (! serverauth) return EOPNOTSUPP; - if (rendezvous == MACH_PORT_DEAD) /* Port died in transit. */ + if (rendezvous == MACH_PORT_NULL || rendezvous == MACH_PORT_DEAD) return EINVAL; mutex_lock (&pending_lock); -- cgit v1.2.3