From 114bf777bb81bae31d7c430c1cf63be3f35e2be4 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 6 Oct 2008 17:30:07 -0600 Subject: [PATCH] avoid null pointer deref in Java_java_io_RandomAccessFile_open --- classpath/java-io.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classpath/java-io.cpp b/classpath/java-io.cpp index b7e29e8058..acb61554f4 100644 --- a/classpath/java-io.cpp +++ b/classpath/java-io.cpp @@ -459,7 +459,7 @@ Java_java_io_RandomAccessFile_open(JNIEnv* e, jclass, jstring path, jlong peer = reinterpret_cast(mapping); e->SetLongArrayRegion(result, 0, 1, &peer); - jlong length = mapping->length; + jlong length = (mapping ? mapping->length : 0); e->SetLongArrayRegion(result, 1, 1, &length); e->ReleaseStringUTFChars(path, chars);