]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix dns_message_checksig in out-of-tree setup
authorPetr Špaček <pspacek@isc.org>
Tue, 27 Sep 2022 08:39:51 +0000 (10:39 +0200)
committerPetr Špaček <pspacek@isc.org>
Tue, 27 Sep 2022 11:23:25 +0000 (13:23 +0200)
Hardcoded path was missing FUZZDIR prefix.

Related: !5923
(cherry picked from commit 4108d79c9a3bc7a617d7ca24adc1180043ee9919)

fuzz/dns_message_checksig.c

index 21429dd7180ded8c4d621607149194be2e739954..70da0f9d5a37684fc033d41267ba0143f75d1228 100644 (file)
@@ -119,6 +119,7 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
                                     0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
                                     0xff, 0xff, 0xff, 0xff };
        dns_zone_t *zone = NULL;
+       char pathbuf[PATH_MAX];
 
        atexit(cleanup);
 
@@ -174,13 +175,16 @@ LLVMFuzzerInitialize(int *argc __attribute__((unused)),
        dns_zone_setclass(zone, view->rdclass);
        dns_zone_settype(zone, dns_zone_primary);
 
-       result = dns_zone_setkeydirectory(zone, "dns_message_checksig.data");
+       snprintf(pathbuf, sizeof(pathbuf), FUZZDIR "/%s",
+                "dns_message_checksig.data");
+       result = dns_zone_setkeydirectory(zone, pathbuf);
        if (result != ISC_R_SUCCESS) {
                return (1);
        }
 
-       result = dns_zone_setfile(zone, "dns_message_checksig.data/sig0key.db",
-                                 dns_masterformat_text,
+       snprintf(pathbuf, sizeof(pathbuf), FUZZDIR "/%s",
+                "dns_message_checksig.data/sig0key.db");
+       result = dns_zone_setfile(zone, pathbuf, dns_masterformat_text,
                                  &dns_master_style_default);
        if (result != ISC_R_SUCCESS) {
                return (1);