]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check that buf is large enough
authorMark Andrews <marka@isc.org>
Tue, 11 Jul 2023 07:57:25 +0000 (17:57 +1000)
committerMark Andrews <marka@isc.org>
Fri, 1 Sep 2023 02:01:20 +0000 (12:01 +1000)
lib/dns/opensslecdsa_link.c

index a2239e265140041016661e8b3e83aa6b434ebb2e..b54e43ade3a424a51bb99825bbbb7b012325a2c7 100644 (file)
@@ -112,6 +112,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;
        }