]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/vm/vm_map.c
xnu-2422.115.4.tar.gz
[apple/xnu.git] / osfmk / vm / vm_map.c
index 315ad33874e55bdeda4811386791ab57504dd882..a30ff18e11125f20b58066fa8055af5db71d6133 100644 (file)
@@ -2423,6 +2423,10 @@ vm_map_enter_mem_object(
                if ((named_entry->protection & cur_protection) !=
                    cur_protection)
                        return KERN_INVALID_RIGHT;
+               if (offset + size < offset) {
+                       /* overflow */
+                       return KERN_INVALID_ARGUMENT;
+               }
                if (named_entry->size < (offset + size))
                        return KERN_INVALID_ARGUMENT;