cp/avian/java-net.cpp: fix segfault

In Java_java_net_InetAddress_ipv4AddressForName:
  Throw nullptrex on hostname = null.
This commit is contained in:
Timofey Lagutin 2014-10-10 19:06:36 +04:00
parent e7e54ad52b
commit a820370cb2

View File

@ -97,6 +97,11 @@ extern "C" JNIEXPORT jint JNICALL
jclass,
jstring name)
{
if(!name) {
throwNew(e, "java/lang/NullPointerException", 0);
return 0;
}
const char* chars = e->GetStringUTFChars(name, 0);
if (chars) {
#ifdef PLATFORM_WINDOWS