diff options
author | Matt Caswell <matt@openssl.org> | 2018-02-12 17:47:50 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2018-02-15 15:24:47 +0000 |
commit | 0d502c3511ab3b1c8acb129fb3af836727b8092d (patch) | |
tree | 6c2c515767d0c9f10b63e2acd79343408676fa34 /apps/ca.c | |
parent | bc2a0dd283c0f61df572b8c2aaf3bfc2dd4b7571 (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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |