From a820370cb22861e5d665002a75e809d897f4de84 Mon Sep 17 00:00:00 2001 From: Timofey Lagutin Date: Fri, 10 Oct 2014 19:06:36 +0400 Subject: [PATCH] cp/avian/java-net.cpp: fix segfault In Java_java_net_InetAddress_ipv4AddressForName: Throw nullptrex on hostname = null. --- classpath/java-net.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classpath/java-net.cpp b/classpath/java-net.cpp index b6eaca086f..20ba2890e2 100644 --- a/classpath/java-net.cpp +++ b/classpath/java-net.cpp @@ -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