8017271: Crash may occur in java.net.DualStackPlainSocketImpl::initIDs due to unchecked values returned from JNI functions
authorchegar
Sat, 22 Jun 2013 08:14:54 +0100
changeset 18540 1f637992378a
parent 18539 cc30fa6fcf7c
child 18541 a974731db859
8017271: Crash may occur in java.net.DualStackPlainSocketImpl::initIDs due to unchecked values returned from JNI functions Reviewed-by: alanb, khazra
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
jdk/src/windows/native/java/net/DualStackPlainSocketImpl.c
--- 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");