changeset 18540:1f637992378a

8017271: Crash may occur in java.net.DualStackPlainSocketImpl::initIDs due to unchecked values returned from JNI functions Reviewed-by: alanb, khazra
author chegar
date Sat, 22 Jun 2013 08:14:54 +0100
parents cc30fa6fcf7c
children a974731db859
files jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Fri Jun 21 13:42:55 2013 -0700
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Sat Jun 22 08:14:54 2013 +0100
@@ -50,7 +50,7 @@
 #ifndef IP_MULTICAST_ALL
 #define IP_MULTICAST_ALL      49
 #endif
-#endif  //  __linux__`
+#endif  //  __linux__
 
 #ifndef IPTOS_TOS_MASK
 #define IPTOS_TOS_MASK 0x1e
--- a/jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c	Fri Jun 21 13:42:55 2013 -0700
+++ b/jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c	Sat Jun 22 08:14:54 2013 +0100
@@ -43,6 +43,7 @@
   (JNIEnv *env, jclass clazz) {
 
     jclass cls = (*env)->FindClass(env, "java/net/InetSocketAddress");
+    CHECK_NULL(cls);
     isa_class = (*env)->NewGlobalRef(env, cls);
     isa_ctorID = (*env)->GetMethodID(env, cls, "<init>",
                                      "(Ljava/net/InetAddress;I)V");