hotspot/src/share/vm/runtime/os.cpp
changeset 14487 9a40ad461ee9
parent 14120 7d298141c258
child 14490 5bb45ed999ee
--- a/hotspot/src/share/vm/runtime/os.cpp	Fri Nov 09 22:22:53 2012 -0800
+++ b/hotspot/src/share/vm/runtime/os.cpp	Mon Nov 12 15:58:11 2012 -0500
@@ -576,7 +576,9 @@
     // if NULL is returned the calling functions assume out of memory.
     size = 1;
   }
-
+  if (size > size + space_before + space_after) { // Check for rollover.
+    return NULL;
+  }
   NOT_PRODUCT(if (MallocVerifyInterval > 0) check_heap());
   u_char* ptr = (u_char*)::malloc(size + space_before + space_after);