[vlc-devel] [PATCH 2/2] actions: Remove VLA usage

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Dec 10 17:15:27 CET 2020


---
 src/misc/actions.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/misc/actions.c b/src/misc/actions.c
index ddbf04ad65..5b6e081f1c 100644
--- a/src/misc/actions.c
+++ b/src/misc/actions.c
@@ -601,7 +601,8 @@ size_t
 vlc_actions_get_keycodes(vlc_object_t *p_obj, const char *psz_key_name,
                         bool b_global, uint_fast32_t **pp_keycodes)
 {
-    char varname[12 /* "global-key-" */ + strlen( psz_key_name )];
+    assert(strlen( psz_key_name ) <= MAXACTION);
+    char varname[12 /* "global-key-" */ + MAXACTION];
     sprintf( varname, "%skey-%s", b_global ? "global-" : "", psz_key_name );
 
     *pp_keycodes = NULL;
-- 
2.29.2



More information about the vlc-devel mailing list