Commit 8a01a853 authored by Rémi Duraffort's avatar Rémi Duraffort

lua_variables: the pointers returned by luaL_checkstring might be invalid when...

lua_variables: the pointers returned by luaL_checkstring might be invalid when the value is poped from the lua stack.
parent 0777f812
......@@ -223,12 +223,13 @@ static int vlclua_command( lua_State *L )
{
vlc_object_t * p_this = vlclua_get_this( L );
char *psz_msg;
const char *psz_name = luaL_checkstring( L, 1 );
const char *psz_cmd = luaL_checkstring( L, 2 );
const char *psz_arg = luaL_checkstring( L, 3 );
int ret = var_Command( p_this, psz_name, psz_cmd, psz_arg, &psz_msg );
lua_pop( L, 3 );
int ret = var_Command( p_this, psz_name, psz_cmd, psz_arg, &psz_msg );
if( psz_msg )
{
lua_pushstring( L, psz_msg );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment