From 9d59eb015141697da616a4b98ac27cf4269cd780 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 17 Feb 2012 23:20:13 -0500 Subject: Make fetchint and fetchstr use proc instead of taking a struct proc Previously, these were inconsistent: they used their struct proc argument for bounds checking, but always copied the argument from the current address space (and hence the current process). Drop the struct proc argument and always use the current proc. Suggested by Carmi Merimovich. --- sysfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysfile.c') diff --git a/sysfile.c b/sysfile.c index e6d08e8..64f2b33 100644 --- a/sysfile.c +++ b/sysfile.c @@ -388,13 +388,13 @@ sys_exec(void) for(i=0;; i++){ if(i >= NELEM(argv)) return -1; - if(fetchint(proc, uargv+4*i, (int*)&uarg) < 0) + if(fetchint(uargv+4*i, (int*)&uarg) < 0) return -1; if(uarg == 0){ argv[i] = 0; break; } - if(fetchstr(proc, uarg, &argv[i]) < 0) + if(fetchstr(uarg, &argv[i]) < 0) return -1; } return exec(path, argv); -- cgit v1.2.3