Commit 0d502c35 authored by Matt Caswell's avatar Matt Caswell
Browse files

Check the return code from ASN1_TIME_diff()



The function can fail so we should check the return code.

Found by Coverity

Reviewed-by: default avatarBernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5339)
parent bc2a0dd2
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;
    }