From 349c7c59f1524678099b3128cdbd693d2bb6aedc Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 2 Sep 1996 05:25:07 +0000 Subject: shmdt when no mapping is ok, found by christos --- sys/kern/sysv_shm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys/kern/sysv_shm.c') diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index ae4cae35341..f31f05f5ef0 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysv_shm.c,v 1.4 1996/04/21 22:27:26 deraadt Exp $ */ +/* $OpenBSD: sysv_shm.c,v 1.5 1996/09/02 05:25:06 deraadt Exp $ */ /* $NetBSD: sysv_shm.c,v 1.37 1996/03/16 23:17:13 christos Exp $ */ /* @@ -178,6 +178,8 @@ sys_shmdt(p, v, retval) int i; shmmap_s = (struct shmmap_state *)p->p_vmspace->vm_shm; + if (shmmap_s == NULL) + return EINVAL; for (i = 0; i < shminfo.shmseg; i++, shmmap_s++) if (shmmap_s->shmid != -1 && shmmap_s->va == (vm_offset_t)SCARG(uap, shmaddr)) -- cgit v1.2.3