mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-23 10:42:35 +00:00
check BIGNUM for null in bn2buf
This commit is contained in:
1 parent
b7e7b00ab3
commit
f438566f53
1 file changed
+1
@@ -130,6 +130,7 @@ namespace crypto
|
||||
|
||||
bool bn2buf (const BIGNUM * bn, uint8_t * buf, size_t len)
|
||||
{
|
||||
if (!bn) return false; // BN_num_bytes dereferences its argument
|
||||
int offset = (int)len - (int)BN_num_bytes (bn);
|
||||
if (offset < 0) return false;
|
||||
BN_bn2bin (bn, buf + offset);
|
||||
|
||||
Reference in new issue
Block a user