IPP: Fix failed assertion for tvb_bytes_to_str()

Check size before calling tvb_bytes_to_str()
Related to #17890
This commit is contained in:
Uli Heilmeier 2022-01-22 22:31:09 +01:00 committed by A Wireshark GitLab Utility
parent 78984d855e
commit 2337761e92
1 changed files with 3 additions and 2 deletions

View File

@ -1249,8 +1249,9 @@ add_octetstring_tree(proto_tree *tree, tvbuff_t *tvb, int offset, int name_lengt
break;
default :
value = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset + 1 + 2 + name_length + 2, value_length);
if (value_length > 0 ) {
value = tvb_bytes_to_str(wmem_packet_scope(), tvb, offset + 1 + 2 + name_length + 2, value_length);
}
valoffset += 1 + 2 + name_length + 2 + value_length;
break;
}