diff options
author | Fredia Huya-Kouadio <fhuyakou@gmail.com> | 2020-05-27 03:05:51 -0700 |
---|---|---|
committer | Fredia Huya-Kouadio <fhuyakou@gmail.com> | 2020-05-27 03:40:26 -0700 |
commit | 63286ebba46f9a7e01284bdff246a60f842cda32 (patch) | |
tree | d68ba81a790df60193e12859cb1d36badb5e1158 /platform/android/plugin | |
parent | e7e736c03be30db520a061a342eba0e81e5d131d (diff) | |
download | redot-engine-63286ebba46f9a7e01284bdff246a60f842cda32.tar.gz |
Use compile-time constant for the size of the signal parameters
Diffstat (limited to 'platform/android/plugin')
-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); |