8304718: GetIntArrayElements should not be passed JNI_FALSE

Reviewed-by: serb
This commit is contained in:
Julian Waters 2023-03-27 15:12:20 +00:00
parent 138cdc9283
commit 6b2f34f88a
3 changed files with 3 additions and 3 deletions

View File

@ -759,7 +759,7 @@ Java_sun_lwawt_macosx_LWCToolkit_initIDs
CHECK_NULL(getButtonDownMasksID);
jintArray obj = (jintArray)(*env)->CallStaticObjectMethod(env, inputEventClazz, getButtonDownMasksID);
CHECK_EXCEPTION();
jint * tmp = (*env)->GetIntArrayElements(env, obj, JNI_FALSE);
jint * tmp = (*env)->GetIntArrayElements(env, obj, NULL);
CHECK_NULL(tmp);
gButtonDownMasks = (jint*)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), gNumberOfButtons);

View File

@ -243,7 +243,7 @@ Java_sun_awt_X11_XRobotPeer_setup (JNIEnv * env, jclass cls, jint numberOfButton
DTRACE_PRINTLN("RobotPeer: setup()");
num_buttons = numberOfButtons;
tmp = (*env)->GetIntArrayElements(env, buttonDownMasks, JNI_FALSE);
tmp = (*env)->GetIntArrayElements(env, buttonDownMasks, NULL);
CHECK_NULL(tmp);
masks = (jint *)SAFE_SIZE_ARRAY_ALLOC(malloc, sizeof(jint), num_buttons);

View File

@ -6584,7 +6584,7 @@ Java_java_awt_Component_initIDs(JNIEnv *env, jclass cls)
"java/awt/event/InputEvent",
"getButtonDownMasks", "()[I").l;
CHECK_NULL(obj);
jint * tmp = env->GetIntArrayElements(obj, JNI_FALSE);
jint * tmp = env->GetIntArrayElements(obj, nullptr);
CHECK_NULL(tmp);
jsize len = env->GetArrayLength(obj);
AwtComponent::masks = SAFE_SIZE_NEW_ARRAY(jint, len);