diff options
author | Joerg Mayer <jmayer@loplof.de> | 2016-06-22 00:23:38 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2016-06-21 22:29:54 +0000 |
commit | 1b1296a045e9f56bf844171a7b83065d2b3a1425 (patch) | |
tree | 9cd0a99a5210b5379b7c8fe03069204cb87cdbef /epan | |
parent | 6cc90dde536beb28671a4537f93f85d67a66a0ff (diff) |
More helpful failure when registration fails.
Change-Id: I3c574c504cc9166d04b5b725a6a393767a58a280
Reviewed-on: https://code.wireshark.org/review/16063
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/capture_dissectors.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/capture_dissectors.c b/epan/capture_dissectors.c index 1692533682..64141cec56 100644 --- a/epan/capture_dissectors.c +++ b/epan/capture_dissectors.c @@ -23,6 +23,7 @@ #include "config.h" #include <glib.h> +#include <stdio.h> #include "packet.h" #include "capture_dissectors.h" @@ -89,6 +90,12 @@ void register_capture_dissector(const char* name, const guint32 pattern, capture /* Make sure table exists */ sub_dissectors = (struct capture_dissector_table*)g_hash_table_lookup( capture_dissector_tables, name ); + if (sub_dissectors == NULL) { + fprintf(stderr, "OOPS: Subdissector \"%s\" not found in capture_dissector_tables\n", name); + if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) + abort(); + return; + } g_assert(sub_dissectors != NULL); /* Make sure the registration is unique */ |