提交 58c03e3b 编写于 作者: H huangqinjin 提交者: Matt Caswell

fix BN_hex2bn()/BN_dec2bn() memory leak

Reviewed-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 753be41d
...@@ -139,7 +139,7 @@ int BN_hex2bn(BIGNUM **bn, const char *a) ...@@ -139,7 +139,7 @@ int BN_hex2bn(BIGNUM **bn, const char *a)
for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++) for (i = 0; i <= (INT_MAX/4) && isxdigit((unsigned char)a[i]); i++)
continue; continue;
if (i > INT_MAX/4) if (i == 0 || i > INT_MAX/4)
goto err; goto err;
num = i + neg; num = i + neg;
...@@ -209,7 +209,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a) ...@@ -209,7 +209,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a)
for (i = 0; i <= (INT_MAX/4) && isdigit((unsigned char)a[i]); i++) for (i = 0; i <= (INT_MAX/4) && isdigit((unsigned char)a[i]); i++)
continue; continue;
if (i > INT_MAX/4) if (i == 0 || i > INT_MAX/4)
goto err; goto err;
num = i + neg; num = i + neg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册