diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-12 13:21:32 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-04-12 13:21:32 +0000 |
commit | b7d653c556be639aa35e08e8759d8729146dc40e (patch) | |
tree | 7e4296c5f8b9753c8bb0ea137f14684dc0025d17 /plugins | |
parent | 5d840e995c02f0a49814bd8506745d444b7e090e (diff) |
localtime() can return a NULL ptr.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36580 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gryphon/packet-gryphon.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/gryphon/packet-gryphon.c b/plugins/gryphon/packet-gryphon.c index d4ec4a1420..63bf50d617 100644 --- a/plugins/gryphon/packet-gryphon.c +++ b/plugins/gryphon/packet-gryphon.c @@ -918,15 +918,21 @@ resp_time(tvbuff_t *tvb, int offset, proto_tree *pt) ts = tvb_get_ntoh64(tvb, offset); timestamp = (time_t) (ts / 100000); tmp = localtime(×tamp); - proto_tree_add_text(pt, tvb, offset, 8, - "Date/Time: %s %d, %d %02d:%02d:%02d.%05u", - mon_names[tmp->tm_mon], - tmp->tm_mday, - tmp->tm_year + 1900, - tmp->tm_hour, - tmp->tm_min, - tmp->tm_sec, - (guint) (ts % 100000)); + + if (tmp) { + proto_tree_add_text(pt, tvb, offset, 8, + "Date/Time: %s %d, %d %02d:%02d:%02d.%05u", + mon_names[tmp->tm_mon], + tmp->tm_mday, + tmp->tm_year + 1900, + tmp->tm_hour, + tmp->tm_min, + tmp->tm_sec, + (guint) (ts % 100000)); + } else { + proto_tree_add_text(pt, tvb, offset, 8, + "Date/Time: [Invalid]"); + } offset += 8; return offset; } |