8195690: JNI GetObjectRefType doesn't handle NULL

Properly handle NULL, add some non-NULL preconditions.

Reviewed-by: dholmes, mdoerr
This commit is contained in:
Kim Barrett 2018-01-23 14:27:10 -05:00
parent 490d2ce747
commit 2d847b1eb6
7 changed files with 26 additions and 6 deletions

View file

@ -435,7 +435,7 @@ static void* check_wrapped_array_release(JavaThread* thr, const char* fn_name,
}
oop jniCheck::validate_handle(JavaThread* thr, jobject obj) {
if (JNIHandles::handle_type(thr, obj) != JNIInvalidRefType) {
if ((obj != NULL) && (JNIHandles::handle_type(thr, obj) != JNIInvalidRefType)) {
ASSERT_OOPS_ALLOWED;
return JNIHandles::resolve_external_guard(obj);
}