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> (cherry picked from commit a7e974c7be90e2c9673e2ce6215a70f734eb8ad4)
This commit is contained in:
parent
a6ce498b2a
commit
1915a22184
@ -141,8 +141,9 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len,
|
|||||||
int utype, char *free_cont, const ASN1_ITEM *it)
|
int utype, char *free_cont, const ASN1_ITEM *it)
|
||||||
{
|
{
|
||||||
BIGNUM *bn;
|
BIGNUM *bn;
|
||||||
if (!*pval)
|
|
||||||
bn_new(pval, it);
|
if (*pval == NULL && !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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user