diff options
-rw-r--r-- | vm/vm_map.c | 3 | ||||
-rw-r--r-- | vm/vm_user.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c index c46afc0..22fa836 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -784,6 +784,9 @@ kern_return_t vm_map_enter( #define RETURN(value) { result = value; goto BailOut; } + if (size == 0) + return KERN_INVALID_ARGUMENT; + StartAgain: ; start = *address; diff --git a/vm/vm_user.c b/vm/vm_user.c index a8ce982..6fe398e 100644 --- a/vm/vm_user.c +++ b/vm/vm_user.c @@ -342,6 +342,9 @@ kern_return_t vm_map( return(KERN_INVALID_ARGUMENT); } + if (size == 0) + return KERN_INVALID_ARGUMENT; + *address = trunc_page(*address); size = round_page(size); |