diff options
author | Peter Wu <lekensteyn@gmail.com> | 2014-02-02 17:20:52 +0100 |
---|---|---|
committer | Alexis La Goutte <alexis.lagoutte@gmail.com> | 2014-02-02 19:24:36 +0000 |
commit | d252d911a06baf525997474b618908c16f09fa67 (patch) | |
tree | c23662c51bef0d3a05c3d8de14ab3648550aa118 /epan | |
parent | 1b2145d931d663c8b4362c310682407fe67eb3d4 (diff) |
Fix dissector exception when GUID is empty in flags
When the GUID (CID or Connection Identifier in a more recent spec) field in Public Flags is 0, a zero-length item would be added.
This trivial patch prevents a dissector exception by checking the length first.
Change-Id: Idf6d970bc1b0b3f1a8e47618a8759f6a0cd54c65
Reviewed-on: https://code.wireshark.org/review/78
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-quic.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-quic.c b/epan/dissectors/packet-quic.c index 7ef1d2dccf..871440fe61 100644 --- a/epan/dissectors/packet-quic.c +++ b/epan/dissectors/packet-quic.c @@ -157,8 +157,10 @@ dissect_quic_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, break; } - proto_tree_add_item(quic_tree, hf_quic_guid, tvb, offset, len_guid, ENC_LITTLE_ENDIAN); - offset += len_guid; + if (len_guid) { + proto_tree_add_item(quic_tree, hf_quic_guid, tvb, offset, len_guid, ENC_LITTLE_ENDIAN); + offset += len_guid; + } /* Version */ if(puflags & PUFLAGS_VRSN){ |