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.
This commit is contained in:
parent
12abb1a561
commit
9d59eb0151
3 changed files with 13 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue