From: Tormod Volden Date: Wed, 3 Jun 2015 19:56:18 +0000 (+0200) Subject: execve: Use ugets for copying argument 0 to udata X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=dafc349f8f598833a09bbccb6232164ba56d718a;p=FUZIX.git execve: Use ugets for copying argument 0 to udata The argument list gets squeezed in at the process memory top, and if it is short, copying all 8 bytes might read above top. Signed-off-by: Tormod Volden --- diff --git a/Kernel/syscall_exec16.c b/Kernel/syscall_exec16.c index a1d42ad0..6575c154 100644 --- a/Kernel/syscall_exec16.c +++ b/Kernel/syscall_exec16.c @@ -210,7 +210,7 @@ arg_t _execve(void) nenvp = wargs((char *) (nargv), ebuf, NULL); // Fill in udata.u_name with Program invocation name - uget((void *) ugetw(nargv), udata.u_name, 8); + ugets((void *) ugetw(nargv), udata.u_name, 8); memcpy(udata.u_ptab->p_name, udata.u_name, 8); brelse(abuf);