changeset 2279:495ba30cf02f

6921111: NullPointerException in PlainDatagramSocketImpl.socketSetOption Reviewed-by: alanb
author chegar
date Tue, 06 Apr 2010 15:44:17 +0100
parents 69002275e0e2
children 0b7f10901f30
files src/solaris/native/java/net/PlainDatagramSocketImpl.c src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c	Tue Apr 06 13:47:59 2010 +0100
+++ b/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/src/windows/native/java/net/TwoStacksPlainDatagramSocketImpl.c	Tue Apr 06 13:47:59 2010 +0100
+++ b/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",