From 81468fca598b0a6f41bb7835dce0377dace71995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Wed, 2 Apr 2025 18:06:52 +0200 Subject: [PATCH] Don't copy EDE codes if source is same as destination 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. (cherry picked from commit 2988ebae214846d6f8efa41d058aa34f7285a7dc) --- lib/dns/ede.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/dns/ede.c b/lib/dns/ede.c index 4b6e7faad7..22e90bb888 100644 --- a/lib/dns/ede.c +++ b/lib/dns/ede.c @@ -137,6 +137,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;