From a68be23b7e09bc9138e3691ec23dd912062c0bed Mon Sep 17 00:00:00 2001 From: John Thacker Date: Sun, 12 Dec 2021 14:22:14 -0500 Subject: [PATCH] proto: Don't crash on adding 64 bit BASE_CUSTOM column Similar to elsewhere, in proto_custom_set don't call hf_try_val[64]_to_str if BASE_CUSTOM is set, even if hfinfo->strings is non-null. Fix #17762. --- epan/proto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epan/proto.c b/epan/proto.c index 2960546102..8886a7d562 100644 --- a/epan/proto.c +++ b/epan/proto.c @@ -6826,7 +6826,7 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence, (guint32) fvalue_get_sinteger(&finfo->value) : fvalue_get_uinteger(&finfo->value); - if (hfinfo->strings && hfinfo->type != FT_FRAMENUM) { + if (hfinfo->strings && hfinfo->type != FT_FRAMENUM && FIELD_DISPLAY(hfinfo->display) != BASE_CUSTOM) { hf_str_val = hf_try_val_to_str(number, hfinfo); } @@ -6858,7 +6858,7 @@ proto_custom_set(proto_tree* tree, GSList *field_ids, gint occurrence, (guint64) fvalue_get_sinteger64(&finfo->value) : fvalue_get_uinteger64(&finfo->value); - if (hfinfo->strings && hfinfo->type != FT_FRAMENUM) { + if (hfinfo->strings && hfinfo->type != FT_FRAMENUM && FIELD_DISPLAY(hfinfo->display) != BASE_CUSTOM) { hf_str_val = hf_try_val64_to_str(number64, hfinfo); }