Use fetchstr for path in sys_exec

上级 4578b584
......@@ -12,6 +12,7 @@
#include "cpu.hh"
#include "net.hh"
#include "kmtrace.hh"
#include "sperf.hh"
static bool
getfile(int fd, sref<file> *f)
......@@ -419,20 +420,17 @@ sys_chdir(const char *path)
}
long
sys_exec(const char *path, u64 uargv)
sys_exec(const char *upath, u64 uargv)
{
ANON_REGION(__func__, &perfgroup);
char *argv[MAXARG];
char pbuf[16];
char path[DIRSIZ+1];
int i;
u64 uarg;
if (fetchstr(pbuf, path, sizeof(pbuf)) < 0)
if (fetchstr(path, upath, sizeof(path)) < 0)
return -1;
if(argcheckstr(path) < 0) {
return -1;
}
mt_ascope ascope("%s(%s)", __func__, path);
memset(argv, 0, sizeof(argv));
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论