8299088: ClassLoader::defineClass2 throws OOME but JNI exception pending thrown by getUTF

Reviewed-by: mchung, naoto
This commit is contained in:
Justin Lu 2023-03-10 17:40:10 +00:00 committed by Naoto Sato
parent a3358b10ca
commit 6f54eda4a4

View File

@ -185,7 +185,6 @@ Java_java_lang_ClassLoader_defineClass2(JNIEnv *env,
if (name != NULL) {
utfName = getUTF(env, name, buf, sizeof(buf));
if (utfName == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
return result;
}
fixClassname(utfName);
@ -196,7 +195,6 @@ Java_java_lang_ClassLoader_defineClass2(JNIEnv *env,
if (source != NULL) {
utfSource = getUTF(env, source, sourceBuf, sizeof(sourceBuf));
if (utfSource == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
goto free_utfName;
}
} else {
@ -301,7 +299,6 @@ Java_java_lang_ClassLoader_findBootstrapClass(JNIEnv *env, jclass dummy,
clname = getUTF(env, classname, buf, sizeof(buf));
if (clname == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
return NULL;
}
fixClassname(clname);