提交 0d502c35 编写于 作者: M Matt Caswell

Check the return code from ASN1_TIME_diff()

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

Found by Coverity
Reviewed-by: NBernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5339)
上级 bc2a0dd2
...@@ -1706,7 +1706,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, ...@@ -1706,7 +1706,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509,
if (enddate != NULL) { if (enddate != NULL) {
int tdays; 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; days = tdays;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册