summaryrefslogtreecommitdiff
path: root/sys/compat/hpux
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-17 11:11:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-17 11:11:14 +0000
commit38db754b25174070ed136b30600e0bcc16dc5822 (patch)
tree6ede5e261dc3fa5116b6facb5742431e45bd2dea /sys/compat/hpux
parent756200b35a82da5cf261e44482d92c2054bd2f30 (diff)
careful with stackgap handling in execve()
Diffstat (limited to 'sys/compat/hpux')
-rw-r--r--sys/compat/hpux/hpux_exec.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/compat/hpux/hpux_exec.c b/sys/compat/hpux/hpux_exec.c
index 20ae5217a80..8092e485a39 100644
--- a/sys/compat/hpux/hpux_exec.c
+++ b/sys/compat/hpux/hpux_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hpux_exec.c,v 1.8 1997/03/26 08:11:06 downsj Exp $ */
+/* $OpenBSD: hpux_exec.c,v 1.9 1997/06/17 11:11:08 deraadt Exp $ */
/* $NetBSD: hpux_exec.c,v 1.8 1997/03/16 10:14:44 thorpej Exp $ */
/*
@@ -305,10 +305,20 @@ hpux_sys_execve(p, v, retval)
void *v;
register_t *retval;
{
- struct hpux_sys_execve_args *uap = v;
+ struct hpux_sys_execve_args /* {
+ syscallarg(char *) path;
+ syscallarg(char **) argv;
+ syscallarg(char **) envp;
+ } */ *uap = v;
+ struct sys_execve_args ap;
+ caddr_t sg;
- caddr_t sg = stackgap_init(p->p_emul);
+ sg = stackgap_init(p->p_emul);
HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
- return (sys_execve(p, (struct sys_execve_args *)&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));
}