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.
This commit is contained in:
John Thacker 2021-12-12 14:22:14 -05:00 committed by Wireshark GitLab Utility
parent e29c6691d0
commit a68be23b7e
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}