changeset 13351:e787bb619c0b

8210598: Strengthen Windows Access Bridge Support Reviewed-by: prr, psadhukhan, rhalade, mschoene
author serb
date Thu, 27 Sep 2018 12:54:50 -0700
parents 01337312ad1e
children 8f2bdd3d7752
files src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp	Fri Sep 28 23:04:10 2018 -0700
+++ b/src/windows/native/sun/bridge/AccessBridgeMessageQueue.cpp	Thu Sep 27 12:54:50 2018 -0700
@@ -32,6 +32,7 @@
 #include "AccessBridgePackages.h"               // for debugging only
 #include <windows.h>
 #include <malloc.h>
+#include <new>
 
 DEBUG_CODE(extern HWND theDialogWindow);
 extern "C" {
@@ -46,6 +47,9 @@
     next = (AccessBridgeQueueElement *) 0;
     previous = (AccessBridgeQueueElement *) 0;
     buffer = (char *) malloc(bufsize);
+    if (buffer == NULL) {
+        throw std::bad_alloc();
+    }
     memcpy(buffer, buf, bufsize);
 }