RPC: call REPORT_DISSECTOR_BUG() rather than abort().

Checking WIRESHARK_ABORT_ON_DISSECTOR_BUG here looks somewhat redundant but it's not:
it's needed to prevent REPORT_DISSECTOR_BUG() from throwing an exception when
we're not dissecting (when nobody's going to catch the exception).

Change-Id: I4dfc484bdf13bca236bfff1388d4399e26880ad7
Reviewed-on: https://code.wireshark.org/review/11272
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Jeff Morriss 2015-10-25 21:15:21 -04:00 committed by Anders Broman
parent d05971449b
commit 3e5b2537f7
1 changed files with 9 additions and 3 deletions

View File

@ -564,20 +564,26 @@ rpc_init_prog(int proto, guint32 prog, int ett, size_t nvers,
proto_get_protocol_long_name(value->proto),
versions[versidx].vers,
proc->strptr);
/* Abort out if desired - but don't throw an exception here! */
if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
abort();
REPORT_DISSECTOR_BUG("RPC: No call handler!");
continue;
}
dissector_add_custom_table_handle("rpc.call", g_memdup(&key, sizeof(rpc_proc_info_key)),
new_create_dissector_handle_with_name(proc->dissect_call, value->proto_id, proc->strptr));
if (proc->dissect_reply == NULL) {
fprintf(stderr, "OOPS: No call handler for %s version %u procedure %s\n",
fprintf(stderr, "OOPS: No reply handler for %s version %u procedure %s\n",
proto_get_protocol_long_name(value->proto),
versions[versidx].vers,
proc->strptr);
/* Abort out if desired - but don't throw an exception here! */
if (getenv("WIRESHARK_ABORT_ON_DISSECTOR_BUG") != NULL)
abort();
REPORT_DISSECTOR_BUG("RPC: No reply handler!");
continue;
}
dissector_add_custom_table_handle("rpc.reply", g_memdup(&key, sizeof(rpc_proc_info_key)),