summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2019-10-04 03:26:59 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2019-10-04 03:26:59 +0000
commit428218712ba038c33b2817186d53bc61ced0fda6 (patch)
tree9057254ca50b228e5face9c9722cebffd2530a62
parent402217cb03ffe581798d0a8c27c8a6cadfa39520 (diff)
Check for gmtime failure in moduli generation. Based on patch from
krishnaiah.bommu@intel.com, ok djm@
-rw-r--r--usr.bin/ssh/moduli.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/moduli.c b/usr.bin/ssh/moduli.c
index f558a53a090..4fa79dc10a1 100644
--- a/usr.bin/ssh/moduli.c
+++ b/usr.bin/ssh/moduli.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: moduli.c,v 1.35 2019/07/03 03:24:02 deraadt Exp $ */
+/* $OpenBSD: moduli.c,v 1.36 2019/10/04 03:26:58 dtucker Exp $ */
/*
* Copyright 1994 Phil Karn <karn@qualcomm.com>
* Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -153,6 +153,8 @@ qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
time(&time_now);
gtm = gmtime(&time_now);
+ if (gtm == NULL)
+ return -1;
res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ",
gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday,