check return value is not negative

This commit is contained in:
Jacob Barthelmeh
2021-03-17 16:50:53 +07:00
parent 1ca3604212
commit 2732ba2bba

View File

@ -31994,6 +31994,10 @@ WOLFSSL_ASN1_INTEGER* wolfSSL_BN_to_ASN1_INTEGER(const WOLFSSL_BIGNUM *bn, WOLFS
}
else {
len = wolfSSL_BN_bn2bin(bn, a->data);
if (len < 0) {
wolfSSL_ASN1_INTEGER_free(a);
return NULL;
}
}
a->length = len;