proto.c: check for proto_item_get_display_repr()

Check if proto item exists

Bug: 16592
Change-Id: Ida6950e94dfee935e448198df6199e96b1140aa2
Reviewed-on: https://code.wireshark.org/review/37350
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
This commit is contained in:
Uli Heilmeier 2020-06-01 07:26:24 +02:00 committed by Jaap Keuter
parent 7c6e1a02ce
commit 66d5bb9dbe
1 changed files with 2 additions and 0 deletions

View File

@ -6828,6 +6828,8 @@ proto_item_get_display_repr(wmem_allocator_t *scope, proto_item *pi)
{
field_info *fi;
if (!pi)
return "";
fi = PITEM_FINFO(pi);
DISSECTOR_ASSERT(fi->hfinfo != NULL);
return fvalue_to_string_repr(scope, &fi->value, FTREPR_DISPLAY, fi->hfinfo->display);