Displaying 1 result from an estimated 1 matches for "qfileout".
Did you mean:
fileout
2019 Oct 03
2
[PATCH] Avoiding Dereferencing of NULL pointer
Signed-off-by: krishnaiah bommu <krishnaiah.bommu at intel.com>
---
moduli.c | 4 +++-
1 file 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 =...