diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-02 05:25:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-09-02 05:25:07 +0000 |
commit | 349c7c59f1524678099b3128cdbd693d2bb6aedc (patch) | |
tree | 6698a14339c4810bd9b4f5704ffaad17b5e79666 /sys/kern/sysv_shm.c | |
parent | 4450ff856eeeb4173ac0cd0a9d536a01d26a10c9 (diff) |
shmdt when no mapping is ok, found by christos
Diffstat (limited to 'sys/kern/sysv_shm.c')
-rw-r--r-- | sys/kern/sysv_shm.c | 4 |
1 files changed, 3 insertions, 1 deletions
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)) |