libprelude/master: Fix Lua module crash.

[email protected] Wed, 8 Jul 2009 16:51:57 +0200 (CEST)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit fc379897a6e0ed2f424b0f1c1322de6069f53109
Author: Yoann Vandoorselaere <[email protected]>
Date:   Thu Jun 25 10:36:14 2009 +0200

    Fix Lua module crash.
    
    Do not attempt to walk through the Lua argument table if it is not
    a table.


========================================

 bindings/lua/libpreludecpp-lua.i |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

========================================

diff --git a/bindings/lua/libpreludecpp-lua.i b/bindings/lua/libpreludecpp-lua.i
index b762d2d..f4796a0 100644
--- a/bindings/lua/libpreludecpp-lua.i
+++ b/bindings/lua/libpreludecpp-lua.i
@@ -323,6 +323,9 @@ int IDMEFValue_to_SWIG(lua_State* L, const IDMEFValue &result)
         __initial_thread = (gl_thread_t) gl_thread_self();
 
         lua_getglobal(L, "arg");
+        if ( ! lua_istable(L, -1) )
+                return;
+
         lua_pushnil(L);
 
         while ( lua_next(L, -2) != 0 ) {
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-ids.org/mailman/listinfo/prelude-cvslog