diff options
author | Joerg Mayer <jmayer@loplof.de> | 2016-06-21 19:56:00 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2016-06-21 18:00:03 +0000 |
commit | d970da40255807ab13d84f865c1b9de124f00c3a (patch) | |
tree | 60e45df78a8767e0c8e805d424ea1c73d0c835e7 /epan/packet.c | |
parent | c3f3bd7fa89af1ccd15440cf401697fc32814ed6 (diff) |
Slightly improve error message in case of initialization errors.
Change-Id: Icb5d4f0f3bc60970737abbf62044f4550e8d3ca3
Reviewed-on: https://code.wireshark.org/review/16059
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'epan/packet.c')
-rw-r--r-- | epan/packet.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/epan/packet.c b/epan/packet.c index a3b024747b..95d6665e16 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -931,8 +931,15 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h sub_dissectors = find_dissector_table(name); /* - * Make sure the dissector table exists. + * Make sure the handle and the dissector table exist. */ + if (handle == NULL) { + fprintf(stderr, "OOPS: handle to register \"%s\" to doesn't exist\n", + name); + if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL) + abort(); + return; + } if (sub_dissectors == NULL) { fprintf(stderr, "OOPS: dissector table \"%s\" doesn't exist\n", name); @@ -943,8 +950,6 @@ dissector_add_uint(const char *name, const guint32 pattern, dissector_handle_t h return; } - /* sanity checks */ - g_assert(handle!=NULL); switch (sub_dissectors->type) { case FT_UINT8: |