From c7e42be2e5baf0a5f351b126cdac5c3d6d9241a0 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 27 Oct 2015 17:41:23 -0700 Subject: 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 --- ui/gtk/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui/gtk/main.c') diff --git a/ui/gtk/main.c b/ui/gtk/main.c index 86a3574843..fc871d718b 100644 --- a/ui/gtk/main.c +++ b/ui/gtk/main.c @@ -2513,8 +2513,9 @@ DIAG_ON(cast-qual) "-G" flag, as the "-G" flag dumps information 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, - splash_update, (gpointer) splash_win); + if (!epan_init(register_all_protocols,register_all_protocol_handoffs, + splash_update, (gpointer) splash_win)) + return 2; splash_update(RA_LISTENERS, NULL, (gpointer)splash_win); -- cgit v1.2.3