wireshark/epan/wslua
Martin Kaiser a3481933f9 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>
2019-05-26 13:08:38 +00:00
..
.editorconfig
CMakeLists.txt CMake: Simplify CMAKE_INSTALL_DATADIR usage 2018-12-03 22:35:37 +00:00
console.lua Lua: remove various logging functions (debug, warn, etc.) 2018-09-07 04:02:45 +00:00
dtd_gen.lua epan: more SPDX convertions. 2018-02-09 14:41:31 +00:00
init_wslua.c Lua: define table.unpack for Lua 5.1 for compatibility 2019-05-17 10:19:32 +00:00
init_wslua.h epan: Remove unnecessary all protocols registration callback 2018-08-29 23:22:44 +00:00
lrexlib.c spdx: more licenses converted. 2018-03-09 04:50:23 +00:00
lrexlib.h spdx: more licenses converted. 2018-03-09 04:50:23 +00:00
lrexlib_algo.h spdx: more licenses converted. 2018-03-09 04:50:23 +00:00
lrexlib_glib.c spdx: more licenses converted. 2018-03-07 15:56:44 +00:00
lrexlib_glib_f.c spdx: more licenses converted. 2018-03-07 15:56:44 +00:00
lua_bitop.c Revert "Some older compilers don't allow diagnostic pragmas inside a function." 2018-09-12 16:29:30 +00:00
lua_bitop.h spdx: more licenses converted. 2018-03-09 04:50:23 +00:00
make-init-lua.pl wslua: Update wslua_register_menu() documentation 2019-01-29 05:47:05 +00:00
make-reg.pl spdx: more licenses converted. 2018-03-07 15:56:44 +00:00
make-taps.pl spdx: more licenses converted. 2018-03-07 15:56:44 +00:00
taps Rename packet-ssl* to packet-tls* 2018-09-25 13:24:17 +00:00
template-init.lua wslua: do not partially disable the Lua API when run as root 2019-02-07 10:30:06 +00:00
wslua.h wslua: simplify __WSLUA_REGISTER_META and _CLASS 2019-02-26 05:32:42 +00:00
wslua_address.c lua: add support for ethernet addresses to the Address class 2018-10-18 07:51:36 +00:00
wslua_byte_array.c epan: Guard g_base64_decode_inplace() against zero length string 2018-09-05 17:19:42 +00:00
wslua_capture_info.c wslua: register attributes along with their class 2019-01-21 11:51:01 +00:00
wslua_column.c wslua: use SPDX identifiers. 2018-02-09 12:31:21 +00:00
wslua_dir.c wslua: fix memleak in Dir.remove_all on error path 2018-05-10 06:16:19 +00:00
wslua_dissector.c wslua: fix error handling for invalid dissector table 2019-05-26 13:08:38 +00:00
wslua_dumper.c wiretap: fix memleaks with wtap_rec::opt_comment 2019-01-25 04:53:10 +00:00
wslua_field.c wslua_field: fix memory leaks in Field_new 2019-01-26 19:43:05 +00:00
wslua_file.c wslua: register attributes along with their class 2019-01-21 11:51:01 +00:00
wslua_file_common.c wslua: use SPDX identifiers. 2018-02-09 12:31:21 +00:00
wslua_file_common.h wslua: use SPDX identifiers. 2018-02-09 12:31:21 +00:00
wslua_file_handler.c Have wtap_read() fill in a wtap_rec and Buffer. 2019-04-05 02:49:43 +00:00
wslua_frame_info.c wslua_file_handler: fix leak of opt_comment 2019-01-26 07:42:00 +00:00
wslua_gui.c wslua: Update wslua_register_menu() documentation 2019-01-29 05:47:05 +00:00
wslua_int64.c spdx: more licenses converted. 2018-03-09 04:50:23 +00:00
wslua_internals.c wslua: register attributes along with their class 2019-01-21 11:51:01 +00:00
wslua_listener.c wslua_listener: fix memleak in tap packet callback 2019-01-27 09:40:56 +00:00
wslua_nstime.c wslua_nstime: fix memleak for bad arguments to NSTime 2019-01-26 09:07:32 +00:00
wslua_pinfo.c wslua(pinfo): fix typo 2019-05-20 07:37:56 +00:00
wslua_pinfo_common.h wslua: use SPDX identifiers. 2018-02-09 12:31:21 +00:00
wslua_pref.c wslua: fix memleaks related to Proto and Pref 2019-01-27 09:43:05 +00:00
wslua_proto.c wslua: Don't defer deletion of subtree indexes 2019-01-29 14:30:37 +00:00
wslua_proto_expert.c wslua: use SPDX identifiers. 2018-02-09 12:31:21 +00:00
wslua_proto_field.c wslua: fix memleak of unregistered ProtoField field 2019-01-27 09:43:26 +00:00
wslua_struct.c spdx: more licenses converted. 2018-03-09 04:50:23 +00:00
wslua_tree.c epan: Convert our PROTO_ITEM_ macros to inline functions. 2019-04-04 04:03:38 +00:00
wslua_tvb.c Add, and use, "fetch signed value" for lengths < 40 bits. 2018-04-10 14:55:45 +00:00
wslua_util.c Revert "Add routines to load Lua programs that assume the path is UTF-8 on Windows." 2018-12-30 07:49:22 +00:00