6921111: NullPointerException in PlainDatagramSocketImpl.socketSetOption
authorchegar
Tue, 06 Apr 2010 15:44:17 +0100
changeset 5200 8172fc66e135
parent 5199 98b1778f0fd1
child 5201 37e71048195f
6921111: NullPointerException in PlainDatagramSocketImpl.socketSetOption Reviewed-by: alanb
jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c
jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c
--- a/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Tue Apr 06 13:47:59 2010 +0100
+++ b/jdk/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Tue Apr 06 15:44:17 2010 +0100
@@ -1143,7 +1143,7 @@
     jobject addr;
     int i;
 
-    if (ni_addrsID == NULL) {
+    if (ni_addrsID == NULL || ia_addressID == NULL) {
         jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
         CHECK_NULL(c);
         ni_addrsID = (*env)->GetFieldID(env, c, "addrs",
--- a/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Tue Apr 06 13:47:59 2010 +0100
+++ b/jdk/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Tue Apr 06 15:44:17 2010 +0100
@@ -1579,7 +1579,7 @@
     jobject addr;
     int i;
 
-    if (ni_addrsID == NULL) {
+    if (ni_addrsID == NULL || ia_familyID == NULL) {
         jclass c = (*env)->FindClass(env, "java/net/NetworkInterface");
         CHECK_NULL_RETURN (c, -1);
         ni_addrsID = (*env)->GetFieldID(env, c, "addrs",