]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/libs/misc.c
Dynamically allocate the dir list to prevent potential array overflows (I believe...
[vlc] / modules / misc / lua / libs / misc.c
index 2ddd4a3bfe96cf06329e4dd1868c14861f92f220..5e5e8060e67927be65e3dab24d8c96b870fba410 100644 (file)
@@ -155,11 +155,11 @@ static int vlclua_cachedir( lua_State *L )
 static int vlclua_datadir_list( lua_State *L )
 {
     const char *psz_dirname = luaL_checkstring( L, 1 );
-    char  *ppsz_dir_list[] = { NULL, NULL, NULL, NULL };
+    char **ppsz_dir_list = NULL;
     char **ppsz_dir = ppsz_dir_list;
     int i = 1;
 
-    if( vlclua_dir_list( vlclua_get_this( L ), psz_dirname, ppsz_dir_list )
+    if( vlclua_dir_list( vlclua_get_this( L ), psz_dirname, &ppsz_dir_list )
         != VLC_SUCCESS )
         return 0;
     lua_newtable( L );