8017271: Crash may occur in java.net.DualStackPlainSocketImpl::initIDs due to unchecked values returned from JNI functions

Reviewed-by: alanb, khazra
This commit is contained in:
Chris Hegarty 2013-06-22 08:14:54 +01:00
parent feace4506d
commit a294d4b6a4
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -43,6 +43,7 @@ JNIEXPORT void JNICALL Java_java_net_DualStackPlainSocketImpl_initIDs
(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");