]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't copy EDE codes if source is same as destination
authorOndřej Surý <ondrej@isc.org>
Wed, 2 Apr 2025 16:06:52 +0000 (18:06 +0200)
committerOndřej Surý <ondrej@isc.org>
Wed, 2 Apr 2025 16:06:52 +0000 (18:06 +0200)
If the nested DNS validator ends up in the same fetch because of the
loops, the code could be copying the EDE codes from the same source EDE
context as the destination EDE context.  Skip copying the EDE codes if
the source and the destination is the same.

lib/dns/ede.c

index 7fbbd8390501ab45607b3fc0627360441f1d4d37..af7cc0b57f7c6b4c842bb3619a93525b900face7 100644 (file)
@@ -134,6 +134,10 @@ dns_ede_copy(dns_edectx_t *edectx_to, const dns_edectx_t *edectx_from) {
        REQUIRE(DNS_EDE_VALID(edectx_to));
        REQUIRE(DNS_EDE_VALID(edectx_from));
 
+       if (edectx_to == edectx_from) {
+               return;
+       }
+
        for (size_t pos = 0; pos < DNS_EDE_MAX_ERRORS; pos++) {
                uint16_t fromcode;