aboutsummaryrefslogtreecommitdiffstats
path: root/packet-diameter.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-diameter.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-diameter.c')
-rw-r--r--packet-diameter.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/packet-diameter.c b/packet-diameter.c
index 77a50cab08..4891518e74 100644
--- a/packet-diameter.c
+++ b/packet-diameter.c
@@ -1,7 +1,7 @@
/* packet-diameter.c
* Routines for DIAMETER packet disassembly
*
- * $Id: packet-diameter.c,v 1.23 2001/06/18 02:17:45 guy Exp $
+ * $Id: packet-diameter.c,v 1.24 2001/07/15 19:14:00 guy Exp $
*
* Copyright (c) 2001 by David Frascone <dave@frascone.com>
*
@@ -702,12 +702,16 @@ static gchar *rd_value_to_str(e_avphdr *avph, const u_char *input, int length)
#endif
case DIAMETER_TIME:
{
- struct tm lt;
+ struct tm *lt;
intval=pntohl(input);
intval -= NTP_TIME_DIFF;
- lt=*localtime((time_t *)&intval);
- strftime(buffer, 1024,
- "%a, %d %b %Y %H:%M:%S %z",&lt);
+ lt=localtime((time_t *)&intval);
+ if (lt != NULL) {
+ strftime(buffer, 1024,
+ "%a, %d %b %Y %H:%M:%S %z",lt);
+ } else {
+ strncpy(buffer, "Not representable", 1024);
+ }
}
default:
/* Do nothing */