proto.c: Use global var insted of environment var

WIRESHARK_ABORT_ON_TOO_MANY_ITEMS
Closes #17275
This commit is contained in:
Anders Broman 2021-03-08 12:49:16 +01:00 committed by Wireshark GitLab Utility
parent 879a33f158
commit 4131019969
2 changed files with 2 additions and 1 deletions

View File

@ -28,6 +28,7 @@ extern "C" {
* to save fetching it repeatedly.
*/
extern gboolean wireshark_abort_on_dissector_bug;
extern gboolean wireshark_abort_on_too_many_items;
typedef struct epan_dissect epan_dissect_t;

View File

@ -109,7 +109,7 @@ struct ptvcursor {
PROTO_REGISTRAR_GET_NTH(hfindex, hfinfo); \
if (PTREE_DATA(tree)->count > prefs.gui_max_tree_items) { \
free_block; \
if (getenv("WIRESHARK_ABORT_ON_TOO_MANY_ITEMS") != NULL) \
if (wireshark_abort_on_too_many_items) \
g_error("Adding %s would put more than %d items in the tree -- possible infinite loop (max number of items can be increased in advanced preferences)", \
hfinfo->abbrev, prefs.gui_max_tree_items); \
/* Let the exception handler add items to the tree */ \