check bn_new return value
Slightly modified from the original PR. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
@@ -163,8 +163,8 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
|||||||
{
|
{
|
||||||
BIGNUM *bn;
|
BIGNUM *bn;
|
||||||
|
|
||||||
if (!*pval)
|
if (*pval == NULL && !bn_new(pval, it))
|
||||||
bn_new(pval, it);
|
return 0;
|
||||||
bn = (BIGNUM *)*pval;
|
bn = (BIGNUM *)*pval;
|
||||||
if (!BN_bin2bn(cont, len, bn)) {
|
if (!BN_bin2bn(cont, len, bn)) {
|
||||||
bn_free(pval, it);
|
bn_free(pval, it);
|
||||||
|
Reference in New Issue
Block a user