diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-05-27 13:05:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 13:05:32 +0200 |
commit | 7b7b872d94eef7a89631c091f2740ccc219df2fc (patch) | |
tree | 83a16361e01bafc49428ec3a0db1a5eca3ed3566 /platform/android | |
parent | 9dc96c0dd8278023a208fbe5d9e6ac530e9fcac9 (diff) | |
parent | 63286ebba46f9a7e01284bdff246a60f842cda32 (diff) |
Merge pull request #39080 from m4gr3d/fix_emit_signal
Use compile-time constant for the size of the signal parameters
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/plugin/godot_plugin_jni.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/platform/android/plugin/godot_plugin_jni.cpp b/platform/android/plugin/godot_plugin_jni.cpp index 053a4c078e..d2528bebeb 100644 --- a/platform/android/plugin/godot_plugin_jni.cpp +++ b/platform/android/plugin/godot_plugin_jni.cpp @@ -114,8 +114,10 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_plugin_GodotPlugin_nativeEmitS String signal_name = jstring_to_string(j_signal_name, env); int count = env->GetArrayLength(j_signal_params); - Variant variant_params[count]; - const Variant *args[count]; + ERR_FAIL_COND_MSG(count > VARIANT_ARG_MAX, "Maximum argument count exceeded!"); + + Variant variant_params[VARIANT_ARG_MAX]; + const Variant *args[VARIANT_ARG_MAX]; for (int i = 0; i < count; i++) { jobject j_param = env->GetObjectArrayElement(j_signal_params, i); |