summaryrefslogtreecommitdiff
path: root/dftest.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-10-27 17:41:23 -0700
committerGuy Harris <guy@alum.mit.edu>2015-10-28 00:44:26 +0000
commitc7e42be2e5baf0a5f351b126cdac5c3d6d9241a0 (patch)
treef0e307a13ade2b261f181b9a58865a17aea00a02 /dftest.c
parent2831d391eff4a08f515effe2f1b20d659e1046ee (diff)
downloadwireshark-c7e42be2e5baf0a5f351b126cdac5c3d6d9241a0.tar.gz
Catch REPORT_DISSECTOR_BUG() calls in dissector registration routines.
Have epan_init() return a success/failure Boolean indication. Catch exceptions when calling the dissector registration routines and, if we get one, report the error and return a failure indication. If epan_init() fails, quit, but first make sure the reported error is displayed. Change-Id: I0300cbb1f66a5644f857a205235124909d684c50 Reviewed-on: https://code.wireshark.org/review/11340 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'dftest.c')
-rw-r--r--dftest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dftest.c b/dftest.c
index c721afcdd0..9af46c16a1 100644
--- a/dftest.c
+++ b/dftest.c
@@ -95,8 +95,9 @@ main(int argc, char **argv)
"-g" flag, as the "-g" flag dumps a list of fields registered
by the dissectors, and we must do it before we read the preferences,
in case any dissectors register preferences. */
- epan_init(register_all_protocols, register_all_protocol_handoffs,
- NULL, NULL);
+ if (!epan_init(register_all_protocols, register_all_protocol_handoffs,
+ NULL, NULL))
+ return 2;
/* set the c-language locale to the native environment. */
setlocale(LC_ALL, "");