Module Name: src Committed By: christos Date: Fri Apr 2 21:37:22 UTC 2010
Modified Files: src/dist/tcpdump: print-radius.c Log Message: check ctime. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/dist/tcpdump/print-radius.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/dist/tcpdump/print-radius.c diff -u src/dist/tcpdump/print-radius.c:1.7 src/dist/tcpdump/print-radius.c:1.8 --- src/dist/tcpdump/print-radius.c:1.7 Tue Jul 24 07:53:46 2007 +++ src/dist/tcpdump/print-radius.c Fri Apr 2 17:37:22 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: print-radius.c,v 1.7 2007/07/24 11:53:46 drochner Exp $ */ +/* $NetBSD: print-radius.c,v 1.8 2010/04/02 21:37:22 christos Exp $ */ /* * Copyright (C) 2000 Alfredo Andres Omella. All rights reserved. @@ -50,7 +50,7 @@ static const char rcsid[] _U_ = "Id: print-radius.c,v 1.27.2.1 2005/09/26 01:02:40 guy Exp"; #else -__RCSID("$NetBSD: print-radius.c,v 1.7 2007/07/24 11:53:46 drochner Exp $"); +__RCSID("$NetBSD: print-radius.c,v 1.8 2010/04/02 21:37:22 christos Exp $"); #endif #endif @@ -737,6 +737,7 @@ { time_t attr_time; char string[26]; + const char *p; if (length != 4) { @@ -747,7 +748,9 @@ TCHECK2(data[0],4); attr_time = EXTRACT_32BITS(data); - strlcpy(string, ctime(&attr_time), sizeof(string)); + if ((p = ctime(&attr_time)) == NULL) + p = "?"; + strlcpy(string, p, sizeof(string)); /* Get rid of the newline */ string[24] = '\0'; printf("%.24s", string);