aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua/wslua_listener.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-08-25 11:19:06 -0700
committerPeter Wu <peter@lekensteyn.nl>2017-08-27 13:45:09 +0000
commitf3ba318e099f62aea51718b73e8e817482beab51 (patch)
treec50cc0cfb13ddd9bcbd5c3cd57e5e6c5f97572bf /epan/wslua/wslua_listener.c
parent22252978a4ec46ce8a0186dc31761293932a8abc (diff)
Lua: fix crash on invalid Dissector.list("food") invocation
The Dissector.list, Listener.list and Field.list functions do not accept a parameter. Passing one however results in a crash because the first element is not the expected table, but the first function parameter. Change-Id: I8483d0aa20716045472f30f5b41a449bed549b05 Reviewed-on: https://code.wireshark.org/review/23209 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'epan/wslua/wslua_listener.c')
-rw-r--r--epan/wslua/wslua_listener.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c
index 606d8dddfa..0acb279479 100644
--- a/epan/wslua/wslua_listener.c
+++ b/epan/wslua/wslua_listener.c
@@ -279,7 +279,7 @@ WSLUA_CONSTRUCTOR Listener_list (lua_State *L) {
lua_newtable(L);
for (i=1; elist; i++, elist = g_list_next(elist)) {
lua_pushstring(L,(const char *) elist->data);
- lua_rawseti(L,1,i);
+ lua_rawseti(L,-2,i);
}
g_list_free(list);