summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2004-08-01 06:22:29 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2004-08-01 06:22:29 +0000
commitd59991a76955f028a8326881e8eef24d6dd3f521 (patch)
treec51392a7e4d5fe594fc79b3ddc711e6e8d4f3336 /sys/compat
parent3fb7cc0bc469c061027ad859f8391cd882baf8b3 (diff)
proper check for the end of stackgap on growinupperstacks
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/common/compat_util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/compat/common/compat_util.c b/sys/compat/common/compat_util.c
index c11ecca3dd0..42b790225d5 100644
--- a/sys/compat/common/compat_util.c
+++ b/sys/compat/common/compat_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat_util.c,v 1.9 2002/07/20 19:24:57 art Exp $ */
+/* $OpenBSD: compat_util.c,v 1.10 2004/08/01 06:22:28 mickey Exp $ */
/* $NetBSD: compat_util.c,v 1.4 1996/03/14 19:31:45 christos Exp $ */
/*
@@ -218,8 +218,13 @@ stackgap_alloc(sgp, sz)
sz = ALIGN(sz);
nsgp = *sgp + sz;
+#ifdef MACHINE_STACK_GROWS_UP
+ if (nsgp > ((caddr_t)PS_STRINGS) + STACKGAPLEN)
+ return NULL;
+#else
if (nsgp > ((caddr_t)PS_STRINGS))
return NULL;
+#endif
*sgp = nsgp;
return n;
}