diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-12-27 12:55:05 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-12-27 12:55:05 +0000 |
commit | 93218a7c76f1ab7653ebd668325950ae75f4d8ff (patch) | |
tree | 712418efb8811b9f10af33b5afa3a3bc21a7ed85 /epan/dissectors/packet-rpc.c | |
parent | db0c2de0045090a315a5eea2550b6fccda8099bb (diff) |
From Pawel Dziepak:dissect_rpc_array causes assertion fault when array is empty. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8145
svn path=/trunk/; revision=46805
Diffstat (limited to 'epan/dissectors/packet-rpc.c')
-rw-r--r-- | epan/dissectors/packet-rpc.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/epan/dissectors/packet-rpc.c b/epan/dissectors/packet-rpc.c index 5d58477515..ae67b68c2d 100644 --- a/epan/dissectors/packet-rpc.c +++ b/epan/dissectors/packet-rpc.c @@ -796,18 +796,19 @@ dissect_rpc_array(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, num = tvb_get_ntohl(tvb, offset); - if( num == 0 ){ - proto_tree_add_none_format(tree, hfindex, tvb, offset, 4, - "no values"); + lock_item = proto_tree_add_item(tree, hfindex, tvb, offset, -1, ENC_NA); + + lock_tree = proto_item_add_subtree(lock_item, ett_rpc_array); + + if(num == 0) { + proto_tree_add_text(lock_tree, tvb, offset, 4, "no values"); offset += 4; + proto_item_set_end(lock_item, tvb, offset); + return offset; } - lock_item = proto_tree_add_item(tree, hfindex, tvb, offset, -1, ENC_NA); - - lock_tree = proto_item_add_subtree(lock_item, ett_rpc_array); - offset = dissect_rpc_uint32(tvb, lock_tree, hf_rpc_array_len, offset); |