summaryrefslogtreecommitdiffstats
path: root/fips
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2014-09-04 12:55:31 -0400
committerRich Salz <rsalz@openssl.org>2014-09-08 10:53:59 -0400
commit3173622ef6e8a596bf031e9b8a1eae4cd072ce03 (patch)
treec62e4be04276fc89eae3a682e8ba0be87c1cecd0 /fips
parent683cd7c9485009efcd5b522357519f0c7e1d4c47 (diff)
RT2849: Redundant check of "dsa" variable.
In the current code, the check isn't redundant. And in fact the REAL check was missing. This avoids a NULL-deref crash. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Diffstat (limited to 'fips')
-rw-r--r--fips/dsa/fips_dssvs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fips/dsa/fips_dssvs.c b/fips/dsa/fips_dssvs.c
index e2f2297f00..6a0b40fc41 100644
--- a/fips/dsa/fips_dssvs.c
+++ b/fips/dsa/fips_dssvs.c
@@ -552,6 +552,11 @@ static void keypair(FILE *in, FILE *out)
int n=atoi(value);
dsa = FIPS_dsa_new();
+ if (!dsa)
+ {
+ fprintf(stderr, "DSA allocation error\n");
+ exit(1);
+ }
if (!dsa2 && !dsa_builtin_paramgen(dsa, L, N, NULL, NULL, 0,
NULL, NULL, NULL, NULL))
{
@@ -578,8 +583,7 @@ static void keypair(FILE *in, FILE *out)
do_bn_print_name(out, "Y",dsa->pub_key);
fputs(RESP_EOL, out);
}
- if (dsa)
- FIPS_dsa_free(dsa);
+ FIPS_dsa_free(dsa);
}
}
}