diff options
author | Bill Meier <wmeier@newsguy.com> | 2011-04-12 13:21:32 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2011-04-12 13:21:32 +0000 |
commit | e3f4dc17a93f2b614d0229ede3b5963d2a4a94c7 (patch) | |
tree | 7e4296c5f8b9753c8bb0ea137f14684dc0025d17 /plugins/gryphon/packet-gryphon.c | |
parent | 42f41ddf0b56fbb885170e06c008407a3378fe13 (diff) | |
download | wireshark-e3f4dc17a93f2b614d0229ede3b5963d2a4a94c7.tar.gz wireshark-e3f4dc17a93f2b614d0229ede3b5963d2a4a94c7.tar.bz2 wireshark-e3f4dc17a93f2b614d0229ede3b5963d2a4a94c7.zip |
localtime() can return a NULL ptr.
svn path=/trunk/; revision=36580
Diffstat (limited to 'plugins/gryphon/packet-gryphon.c')
-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; } |