Loading core/jni/android_net_LocalSocketImpl.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,11 @@ socket_connect_local(JNIEnv *env, jobject object, int ret; int fd; if (name == NULL) { jniThrowNullPointerException(env, NULL); return; } fd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionCheck()) { Loading core/tests/coretests/src/android/net/LocalSocketTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.test.MoreAsserts; import android.test.suitebuilder.annotation.SmallTest; import junit.framework.TestCase; import java.io.FileDescriptor; Loading @@ -39,6 +40,20 @@ public class LocalSocketTest extends TestCase { ls = new LocalSocket(); try { ls.connect(new LocalSocketAddress(null)); fail("Expected NullPointerException"); } catch (NullPointerException e) { // pass } try { ls.bind(new LocalSocketAddress(null)); fail("Expected NullPointerException"); } catch (NullPointerException e) { // pass } ls.connect(new LocalSocketAddress("android.net.LocalSocketTest")); ls1 = ss.accept(); Loading Loading
core/jni/android_net_LocalSocketImpl.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -58,6 +58,11 @@ socket_connect_local(JNIEnv *env, jobject object, int ret; int fd; if (name == NULL) { jniThrowNullPointerException(env, NULL); return; } fd = jniGetFDFromFileDescriptor(env, fileDescriptor); if (env->ExceptionCheck()) { Loading
core/tests/coretests/src/android/net/LocalSocketTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.test.MoreAsserts; import android.test.suitebuilder.annotation.SmallTest; import junit.framework.TestCase; import java.io.FileDescriptor; Loading @@ -39,6 +40,20 @@ public class LocalSocketTest extends TestCase { ls = new LocalSocket(); try { ls.connect(new LocalSocketAddress(null)); fail("Expected NullPointerException"); } catch (NullPointerException e) { // pass } try { ls.bind(new LocalSocketAddress(null)); fail("Expected NullPointerException"); } catch (NullPointerException e) { // pass } ls.connect(new LocalSocketAddress("android.net.LocalSocketTest")); ls1 = ss.accept(); Loading