diff options
author | bde <bde@FreeBSD.org> | 1998-07-15 06:19:33 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-07-15 06:19:33 +0000 |
commit | 3b46a89ac7eeab6b9e68e89309a117c0092b5e7d (patch) | |
tree | eb0fd70b89a8bb42e44fdff7b5dbf355f103c5a9 | |
parent | 9263747c51af01739210cc94f67dc55ee3328c1b (diff) | |
download | FreeBSD-src-3b46a89ac7eeab6b9e68e89309a117c0092b5e7d.zip FreeBSD-src-3b46a89ac7eeab6b9e68e89309a117c0092b5e7d.tar.gz |
Cast between longs and pointers via intptr_t. The results of fuword()
should be checked before casting. The results of suword() should be
checked.
-rw-r--r-- | sys/kern/kern_exec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index aaeb50b..41d5ca0 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_exec.c,v 1.82 1998/04/17 22:36:50 des Exp $ + * $Id: kern_exec.c,v 1.83 1998/06/07 17:11:33 dfr Exp $ */ #include <sys/param.h> @@ -313,7 +313,7 @@ interpret: p->p_acflag &= ~AFORK; /* Set entry address */ - setregs(p, imgp->entry_addr, (u_long)stack_base); + setregs(p, imgp->entry_addr, (u_long)(uintptr_t)stack_base); exec_fail_dealloc: @@ -485,7 +485,7 @@ exec_extract_strings(imgp) argv = imgp->uap->argv; if (argv) { - argp = (caddr_t) fuword(argv); + argp = (caddr_t) (intptr_t) fuword(argv); if (argp == (caddr_t) -1) return (EFAULT); if (argp) @@ -505,7 +505,7 @@ exec_extract_strings(imgp) imgp->stringspace -= length; imgp->stringp += length; imgp->argc++; - } while ((argp = (caddr_t) fuword(argv++))); + } while ((argp = (caddr_t) (intptr_t) fuword(argv++))); } } @@ -516,7 +516,7 @@ exec_extract_strings(imgp) envv = imgp->uap->envv; if (envv) { - while ((envp = (caddr_t) fuword(envv++))) { + while ((envp = (caddr_t) (intptr_t) fuword(envv++))) { if (envp == (caddr_t) -1) return (EFAULT); if ((error = copyinstr(envp, imgp->stringp, @@ -603,14 +603,14 @@ exec_copyout_strings(imgp) /* * Fill in "ps_strings" struct for ps, w, etc. */ - suword(&arginfo->ps_argvstr, (long)vectp); + suword(&arginfo->ps_argvstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nargvstr, argc); /* * Fill in argument portion of vector table. */ for (; argc > 0; --argc) { - suword(vectp++, (long)destp); + suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) destp++; destp++; @@ -619,14 +619,14 @@ exec_copyout_strings(imgp) /* a null vector table pointer seperates the argp's from the envp's */ suword(vectp++, 0); - suword(&arginfo->ps_envstr, (long)vectp); + suword(&arginfo->ps_envstr, (long)(intptr_t)vectp); suword(&arginfo->ps_nenvstr, envc); /* * Fill in environment portion of vector table. */ for (; envc > 0; --envc) { - suword(vectp++, (long)destp); + suword(vectp++, (long)(intptr_t)destp); while (*stringp++ != 0) destp++; destp++; |