]> git.sesse.net Git - vlc/commitdiff
Fix NULL pointer dereferencing due to c58a5af7401735b50fa058fe5ab83d8ae911de4c.
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 27 Feb 2010 22:00:12 +0000 (23:00 +0100)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 27 Feb 2010 22:00:12 +0000 (23:00 +0100)
modules/misc/lua/libs/misc.c

index 4460e12e6b01b77e76763cf390c528f9dceb1ec7..10d1424a1a8f3889985726d68f4350af24bc94ea 100644 (file)
@@ -162,14 +162,13 @@ static int vlclua_datadir_list( lua_State *L )
 {
     const char *psz_dirname = luaL_checkstring( L, 1 );
     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 )
         != VLC_SUCCESS )
         return 0;
     lua_newtable( L );
-    for( ; *ppsz_dir; ppsz_dir++ )
+    for( char **ppsz_dir = ppsz_dir_list; *ppsz_dir; ppsz_dir++ )
     {
         lua_pushstring( L, *ppsz_dir );
         lua_rawseti( L, -2, i );