aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wslua
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2019-05-25 16:47:59 +0200
committerAnders Broman <a.broman58@gmail.com>2019-05-26 13:08:38 +0000
commita3481933f9719b053f3178c3da6fc3af2d9f5c53 (patch)
tree0d8ffa1e0f944ab37316fb2b4d69564b74fe3db9 /epan/wslua
parentae9d528c5fe2e843693da5d78480eeb9c945476c (diff)
wslua: fix error handling for invalid dissector table
Calling DissectorTables's try method for a dissector table of an unknown type crashes Wireshark. local dt = DissectorTable.get("iso14443.subdissector") dt:try(0, tvbuf, pinfo, tree) causes a segmentation fault Thread 1 "wireshark" received signal SIGSEGV, Segmentation fault. except_pop () at /media/sf_wireshark.git/epan/except.c:264 264 set_top(top->except_down); (gdb) print top $1 = (struct except_stacknode *) 0x2 (gdb) bt at /media/sf_wireshark.git/epan/packet.c:590 My gut feeling (I haven't verified this) is that we should not call luaL_error() inside a TRY-CATCH block. DissectorTable_try does this when the type of the dissector table is not supported. Fall back to the data dissector in this case and bring up an expert info instead of aborting the dissection completely. Change-Id: I9a49f738a99b2618014f41050d8c0bf6bfbb4138 Reviewed-on: https://code.wireshark.org/review/33357 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/wslua')
-rw-r--r--epan/wslua/wslua_dissector.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/epan/wslua/wslua_dissector.c b/epan/wslua/wslua_dissector.c
index f25aa4b85c..2deae54733 100644
--- a/epan/wslua/wslua_dissector.c
+++ b/epan/wslua/wslua_dissector.c
@@ -541,7 +541,7 @@ WSLUA_METHOD DissectorTable_try (lua_State *L) {
handled = TRUE;
}
} else {
- luaL_error(L,"No such type of dissector_table");
+ error = "No such type of dissector table";
}
if (!handled) {