diff --git a/epan/dissectors/packet-tn5250.c b/epan/dissectors/packet-tn5250.c index f7b7b5fe8f..8624cb9b04 100644 --- a/epan/dissectors/packet-tn5250.c +++ b/epan/dissectors/packet-tn5250.c @@ -4654,6 +4654,8 @@ dissect_write_structured_field(proto_tree *tn5250_tree, tvbuff_t *tvb, gint offs length = tvb_get_guint8(tvb,offset); proto_tree_add_item(tn5250_tree, hf_tn5250_length, tvb, offset, 1, ENC_BIG_ENDIAN); + if (length==0) + break; proto_tree_add_item(tn5250_tree, hf_tn5250_dpt_ec, tvb, offset, length, ENC_EBCDIC|ENC_NA); offset += length;