We only create hash tables if somebody puts a handler in one, so we need
to check whether the hash table exists first, to avoid run-time warnings.
Change-Id: I739d2d808935e651b11bd44b258f168a42ca4b7c
Reviewed-on: https://code.wireshark.org/review/5683
Reviewed-by: Guy Harris <guy@alum.mit.edu>
/*
* Do we have a handler for this packet block option code?
*/
- handler = (option_handler)g_hash_table_lookup(option_handlers[BT_INDEX_PBS],
- GUINT_TO_POINTER((guint)oh->option_code));
- if (handler != NULL) {
+ if (option_handlers[BT_INDEX_PBS] != NULL &&
+ (handler = (option_handler)g_hash_table_lookup(option_handlers[BT_INDEX_PBS],
+ GUINT_TO_POINTER((guint)oh->option_code))) != NULL) {
/* Yes - call the handler. */
if (!handler(pn->byte_swapped, oh->option_length,
option_content, err, err_info))