From 7aa475db4ce168401167dc2ffed6221493ae2db4 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Tue, 20 Nov 2012 23:17:12 +0000 Subject: Fix calls to vm_map when size is 0 * vm/vm_map.c (vm_map_enter): return KERN_INVALID_ARGUMENT if size is 0. * vm/vm_user.c (vm_map): Likewise. --- vm/vm_map.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vm/vm_map.c') diff --git a/vm/vm_map.c b/vm/vm_map.c index c46afc07..22fa836d 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; -- cgit v1.2.3