summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2010-03-24 03:13:24 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2010-03-24 03:13:24 +0000
commit32325226c5ca5fed0d19cc1a6a94ae7e43675a4c (patch)
treeeb929196535a21784062f4a6d0b2139eaa4d5694 /sys/kern/kern_exec.c
parent3d3046680b908069514f91744b9b66a872e7c015 (diff)
downloadFreeBSD-src-32325226c5ca5fed0d19cc1a6a94ae7e43675a4c.zip
FreeBSD-src-32325226c5ca5fed0d19cc1a6a94ae7e43675a4c.tar.gz
The nargvstr and nenvstr properties of arginfo are ints, not longs,
so should be copied to userspace with suword32() instead of suword(). This alleviates problems on 64-bit big-endian architectures, and is a no-op on all 32-bit architectures. Tested on: amd64, sparc64, powerpc64
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index dce624d..c7a4358 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1260,7 +1260,7 @@ exec_copyout_strings(imgp)
* Fill in "ps_strings" struct for ps, w, etc.
*/
suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp);
- suword(&arginfo->ps_nargvstr, argc);
+ suword32(&arginfo->ps_nargvstr, argc);
/*
* Fill in argument portion of vector table.
@@ -1276,7 +1276,7 @@ exec_copyout_strings(imgp)
suword(vectp++, 0);
suword(&arginfo->ps_envstr, (long)(intptr_t)vectp);
- suword(&arginfo->ps_nenvstr, envc);
+ suword32(&arginfo->ps_nenvstr, envc);
/*
* Fill in environment portion of vector table.
OpenPOWER on IntegriCloud