From b485d95c661606e07dd99dbfbd366538694114b0 Mon Sep 17 00:00:00 2001
From: Mark Andrews <marka@isc.org>
Date: Fri, 3 Jun 2022 16:55:56 +1000
Subject: [PATCH] Clone the message buffer before forwarding UPDATE messages

this prevents named forwarding a buffer that may have been over
written.

(cherry picked from commit 7a42417d61b4273a5819899232e4342b2ae79f03)
---
 lib/ns/update.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ns/update.c b/lib/ns/update.c
index 067ff990bdc..c4bde3d4eb2 100644
--- a/lib/ns/update.c
+++ b/lib/ns/update.c
@@ -1671,6 +1671,7 @@ ns_update_start(ns_client_t *client, isc_nmhandle_t *handle,
 		CHECK(checkupdateacl(client, dns_zone_getforwardacl(zone),
 				     "update forwarding", zonename, true,
 				     false));
+		dns_message_clonebuffer(client->message);
 		CHECK(send_forward_event(client, zone));
 		break;
 	default:
-- 
GitLab

