aboutsummaryrefslogtreecommitdiffstats
path: root/packet-srvloc.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2001-07-15 19:14:03 +0000
committerGuy Harris <guy@alum.mit.edu>2001-07-15 19:14:03 +0000
commitb7255e108a8e22f9fc458ad644e43e9475f51fd0 (patch)
tree868384d9df93246ae15a0650cf5fdcc47b65cb23 /packet-srvloc.c
parente574c8de6d5cd2684265ce041539614c8872f781 (diff)
Fixes, from Scott Renfro, for some calls to "localtime()" that didn't
check whether the call succeeded (it doesn't always do so on Windows, for example). svn path=/trunk/; revision=3722
Diffstat (limited to 'packet-srvloc.c')
-rw-r--r--packet-srvloc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/packet-srvloc.c b/packet-srvloc.c
index 1d0a3f4854..b4494eec87 100644
--- a/packet-srvloc.c
+++ b/packet-srvloc.c
@@ -6,7 +6,7 @@
* In particular I have not had an opportunity to see how it
* responds to SRVLOC over TCP.
*
- * $Id: packet-srvloc.c,v 1.24 2001/06/18 02:17:53 guy Exp $
+ * $Id: packet-srvloc.c,v 1.25 2001/07/15 19:14:00 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -193,12 +193,16 @@ dissect_authblk(tvbuff_t *tvb, int offset, proto_tree *tree)
seconds = tvb_get_ntohl(tvb, offset) - 2208988800ul;
stamp = gmtime(&seconds);
- floatsec = stamp->tm_sec + tvb_get_ntohl(tvb, offset + 4) / 4294967296.0;
- proto_tree_add_text(tree, tvb, offset, 8,
- "Timestamp: %04d-%02d-%02d %02d:%02d:%07.4f UTC",
- stamp->tm_year + 1900, stamp->tm_mon + 1,
- stamp->tm_mday, stamp->tm_hour, stamp->tm_min,
- floatsec);
+ if (stamp != NULL) {
+ floatsec = stamp->tm_sec + tvb_get_ntohl(tvb, offset + 4) / 4294967296.0;
+ proto_tree_add_text(tree, tvb, offset, 8,
+ "Timestamp: %04d-%02d-%02d %02d:%02d:%07.4f UTC",
+ stamp->tm_year + 1900, stamp->tm_mon + 1,
+ stamp->tm_mday, stamp->tm_hour, stamp->tm_min,
+ floatsec);
+ } else {
+ proto_tree_add_text(tree, tvb, offset, 8, "Timestamp not representable");
+ }
proto_tree_add_text(tree, tvb, offset + 8, 2, "Block Structure Desciptor: %u",
tvb_get_ntohs(tvb, offset + 8));
length = tvb_get_ntohs(tvb, offset + 10);