aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2011-04-12 13:21:32 +0000
committerBill Meier <wmeier@newsguy.com>2011-04-12 13:21:32 +0000
commite3f4dc17a93f2b614d0229ede3b5963d2a4a94c7 (patch)
tree7e4296c5f8b9753c8bb0ea137f14684dc0025d17 /plugins
parent42f41ddf0b56fbb885170e06c008407a3378fe13 (diff)
localtime() can return a NULL ptr.
svn path=/trunk/; revision=36580
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gryphon/packet-gryphon.c24
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(&timestamp);
- 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;
}