Check that buf is large enough

(cherry picked from commit 299f519b09)
This commit is contained in:
Mark Andrews 2023-07-11 17:57:25 +10:00
parent f77ffa7953
commit 29a93d2889

View file

@ -258,6 +258,8 @@ static int
BN_bn2bin_fixed(const BIGNUM *bn, unsigned char *buf, int size) {
int bytes = size - BN_num_bytes(bn);
INSIST(bytes >= 0);
while (bytes-- > 0) {
*buf++ = 0;
}