diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-03-21 20:01:35 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-03-21 20:01:35 +0000 |
commit | d2afae82115447ab83cba996489405207ae925e9 (patch) | |
tree | d82a9c216b038169e738ee9f487ec3776abd1215 /epan/dissectors/packet-kink.c | |
parent | 22084517add35cf59eed1c8acbd63bb599b33840 (diff) | |
download | wireshark-d2afae82115447ab83cba996489405207ae925e9.tar.gz |
two bugfixes (reported by buildbot randpkt):
don't use the return value of gmtime, if it's NULL
prevent from an endless loop, if payload_length is 0
svn path=/trunk/; revision=13853
Diffstat (limited to 'epan/dissectors/packet-kink.c')
-rw-r--r-- | epan/dissectors/packet-kink.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/epan/dissectors/packet-kink.c b/epan/dissectors/packet-kink.c index bc0431bf39..e19127e316 100644 --- a/epan/dissectors/packet-kink.c +++ b/epan/dissectors/packet-kink.c @@ -413,8 +413,12 @@ dissect_payload_kink_ap_rep(packet_info *pinfo, tvbuff_t *tvb, int offset, proto /* Analize time by the utc. */ timer = tvb_get_ntohl(tvb, offset); tp = gmtime(&timer); - proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: month %u. day %u. year %u.%u.%u.%u by UTC", + if(tp){ + proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: month %u. day %u. year %u.%u.%u.%u by UTC", (tp->tm_mon)+1, tp->tm_mday, (tp->tm_year)+1900, tp->tm_hour, tp->tm_min, tp->tm_sec); + } else { + proto_tree_add_text(payload_kink_ap_rep_tree, tvb, offset, 4, "EPOCH: value invalid"); + } offset += 4; if(payload_length > PAYLOAD_HEADER){ @@ -821,7 +825,11 @@ dissect_payload_kink_not_defined(packet_info *pinfo, tvbuff_t *tvb, int offset, payload_length += (PADDING - (payload_length % PADDING)); } offset = start_payload_offset + payload_length; - control_payload(pinfo, tvb, offset, next_payload, tree); + + /* XXX - prevent an endless loop if payload_length is 0, don't know the correct way to handle this! */ + if(payload_length != 0) { + control_payload(pinfo, tvb, offset, next_payload, tree); + } } /* Output part */ |