[vlc-commits] commit: lua_variables: the pointers returned by luaL_checkstring might be invalid when the value is poped from the lua stack . (=?UTF-8?Q?R=C3=A9mi=20Duraffort=20?=)
git at videolan.org
git at videolan.org
Fri Dec 3 17:28:57 CET 2010
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Dec 3 17:26:26 2010 +0100| [8a01a85330e01474597a4207891dd0b7b941de40] | committer: Rémi Duraffort
lua_variables: the pointers returned by luaL_checkstring might be invalid when the value is poped from the lua stack.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8a01a85330e01474597a4207891dd0b7b941de40
---
modules/misc/lua/libs/variables.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/modules/misc/lua/libs/variables.c b/modules/misc/lua/libs/variables.c
index e000c26..28109c9 100644
--- a/modules/misc/lua/libs/variables.c
+++ b/modules/misc/lua/libs/variables.c
@@ -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 );
More information about the vlc-commits
mailing list