diff --git a/syscall.c b/syscall.c index a84a921..9ae7536 100644 --- a/syscall.c +++ b/syscall.c @@ -58,7 +58,7 @@ argptr(int n, char **pp, int size) if(argint(n, &i) < 0) return -1; - if((uint)i >= proc->sz || (uint)i+size > proc->sz) + if(size < 0 || (uint)i >= proc->sz || (uint)i+size > proc->sz) return -1; *pp = (char*)i; return 0;