diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-06-17 11:11:14 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-06-17 11:11:14 +0000 |
commit | 38db754b25174070ed136b30600e0bcc16dc5822 (patch) | |
tree | 6ede5e261dc3fa5116b6facb5742431e45bd2dea /sys/compat/freebsd/freebsd_file.c | |
parent | 756200b35a82da5cf261e44482d92c2054bd2f30 (diff) |
careful with stackgap handling in execve()
Diffstat (limited to 'sys/compat/freebsd/freebsd_file.c')
-rw-r--r-- | sys/compat/freebsd/freebsd_file.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/compat/freebsd/freebsd_file.c b/sys/compat/freebsd/freebsd_file.c index 35ceab5ce3a..52d8c6cfe99 100644 --- a/sys/compat/freebsd/freebsd_file.c +++ b/sys/compat/freebsd/freebsd_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: freebsd_file.c,v 1.5 1996/08/02 20:34:45 niklas Exp $ */ +/* $OpenBSD: freebsd_file.c,v 1.6 1997/06/17 11:11:07 deraadt Exp $ */ /* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */ /* @@ -400,10 +400,17 @@ freebsd_sys_execve(p, v, retval) syscallarg(char **) argp; syscallarg(char **) envp; } */ *uap = v; - caddr_t sg = stackgap_init(p->p_emul); + struct sys_execve_args ap; + caddr_t sg; + sg = stackgap_init(p->p_emul); FREEBSD_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - return sys_execve(p, uap, retval); + + SCARG(&ap, path) = SCARG(uap, path); + SCARG(&ap, argp) = SCARG(uap, argp); + SCARG(&ap, envp) = SCARG(uap, envp); + + return sys_execve(p, &ap, retval); } int |