Skip to content

Commit 2a67508

Browse files
mikecatkaashoek
authored andcommitted
fix memory region validation in argptr()
1 parent 0df5f11 commit 2a67508

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

syscall.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ argptr(int n, char **pp, int size)
5858

5959
if(argint(n, &i) < 0)
6060
return -1;
61-
if((uint)i >= proc->sz || (uint)i+size > proc->sz)
61+
if(size < 0 || (uint)i >= proc->sz || (uint)i+size > proc->sz)
6262
return -1;
6363
*pp = (char*)i;
6464
return 0;

0 commit comments

Comments
 (0)