summaryrefslogtreecommitdiff
path: root/moduli.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2019-10-04 03:26:58 +0000
committerDamien Miller <djm@mindrot.org>2019-10-04 13:40:57 +1000
commit714031a10bbe378a395a93cf1040f4ee1451f45f (patch)
tree419dcf47b9959333cb50e4feafdb77457673c7a7 /moduli.c
parent6918974405cc28ed977f802fd97a9c9a9b2e141b (diff)
upstream: Check for gmtime failure in moduli generation. Based on
patch from krishnaiah.bommu@intel.com, ok djm@ OpenBSD-Commit-ID: 4c6a4cde0022188ac83737de08da0e875704eeaa
Diffstat (limited to 'moduli.c')
-rw-r--r--moduli.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/moduli.c b/moduli.c
index 578fc485c..4f6f8da8d 100644
--- a/moduli.c
+++ b/moduli.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: moduli.c,v 1.35 2019/07/03 03:24:02 deraadt Exp $ */ 1/* $OpenBSD: moduli.c,v 1.36 2019/10/04 03:26:58 dtucker Exp $ */
2/* 2/*
3 * Copyright 1994 Phil Karn <karn@qualcomm.com> 3 * Copyright 1994 Phil Karn <karn@qualcomm.com>
4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com> 4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
@@ -159,6 +159,8 @@ qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
159 159
160 time(&time_now); 160 time(&time_now);
161 gtm = gmtime(&time_now); 161 gtm = gmtime(&time_now);
162 if (gtm == NULL)
163 return -1;
162 164
163 res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ", 165 res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ",
164 gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday, 166 gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday,