]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix builds for the OSS-Fuzz project
authorMiltos Allamanis <mallamanis@google.com>
Tue, 3 Jun 2025 15:30:43 +0000 (15:30 +0000)
committerOndřej Surý <ondrej@isc.org>
Tue, 3 Jun 2025 16:41:45 +0000 (18:41 +0200)
Since 70b1777d8aef75da1b184fe8155dc818ce66628a was commited the OSS-Fuzz
build was broken because the `chunk_get_raw()` was not updated in the
`FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION`-enabled area.  Add the `size`
argument to the fuzzing version of the `chunk_get_raw()` function.

lib/dns/qp.c

index afed2a7fcf69b9bbbe58dfe846a1c340bf21b832..7436d07cf5483c659e18468cbf305aa3eed5dd75 100644 (file)
@@ -392,7 +392,7 @@ chunk_size_raw(void) {
 }
 
 static void *
-chunk_get_raw(dns_qp_t *qp) {
+chunk_get_raw(dns_qp_t *qp, size_t len) {
        if (qp->write_protect) {
                size_t size = chunk_size_raw();
                void *ptr = mmap(NULL, size, PROT_READ | PROT_WRITE,
@@ -400,7 +400,7 @@ chunk_get_raw(dns_qp_t *qp) {
                RUNTIME_CHECK(ptr != MAP_FAILED);
                return ptr;
        } else {
-               return isc_mem_allocate(qp->mctx, QP_CHUNK_BYTES);
+               return isc_mem_allocate(qp->mctx, len);
        }
 }