Skip to content

Commit

Permalink
fix memory region validation in argptr()
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecat authored and kaashoek committed Sep 26, 2016
1 parent 0df5f11 commit 2a67508
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a67508

Please sign in to comment.