summaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-02-12 17:47:50 +0000
committerMatt Caswell <matt@openssl.org>2018-02-15 15:24:47 +0000
commit0d502c3511ab3b1c8acb129fb3af836727b8092d (patch)
tree6c2c515767d0c9f10b63e2acd79343408676fa34 /apps/ca.c
parentbc2a0dd283c0f61df572b8c2aaf3bfc2dd4b7571 (diff)
Check the return code from ASN1_TIME_diff()
The function can fail so we should check the return code. Found by Coverity Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de> (Merged from https://github.com/openssl/openssl/pull/5339)
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/ca.c b/apps/ca.c
index a416f368a8..26c077858f 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -1706,7 +1706,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
if (enddate != NULL) {
int tdays;
- ASN1_TIME_diff(&tdays, NULL, NULL, X509_get0_notAfter(ret));
+
+ if (!ASN1_TIME_diff(&tdays, NULL, NULL, X509_get0_notAfter(ret)))
+ goto end;
days = tdays;
}