Displaying 1 result from an estimated 1 matches for "omodulus".
Did you mean:
modulus
2019 Oct 03
2
[PATCH] Avoiding Dereferencing of NULL pointer
...le changed, 3 insertions(+), 1 deletion(-)
diff --git a/moduli.c b/moduli.c
index 578fc48..c1fa484 100644
--- a/moduli.c
+++ b/moduli.c
@@ -153,12 +153,14 @@ static int
qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
u_int32_t osize, u_int32_t ogenerator, BIGNUM * omodulus)
{
- struct tm *gtm;
+ struct tm *gtm = NULL;
time_t time_now;
int res;
time(&time_now);
gtm = gmtime(&time_now);
+ if (!gtm)
+ 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->t...