From 59498ce17f3ced8e0046384cfef12d361760b66c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 4 Mar 2020 13:04:15 +1100 Subject: [PATCH] Quote zone name so that specials are handled --- bin/named/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/named/server.c b/bin/named/server.c index d191959066..781d9e013d 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -7802,15 +7802,15 @@ data_to_cfg(dns_view_t *view, MDB_val *key, MDB_val *data, isc_buffer_t **text, INSIST(zone_config != NULL && zone_config_len > 0); /* zone zonename { config; }; */ - result = isc_buffer_reserve(text, 5 + zone_name_len + 1 + + result = isc_buffer_reserve(text, 6 + zone_name_len + 2 + zone_config_len + 2); if (result != ISC_R_SUCCESS) { goto cleanup; } - CHECK(putstr(text, "zone ")); + CHECK(putstr(text, "zone \"")); CHECK(putmem(text, (const void *)zone_name, zone_name_len)); - CHECK(putstr(text, " ")); + CHECK(putstr(text, "\" ")); CHECK(putmem(text, (const void *)zone_config, zone_config_len)); CHECK(putstr(text, ";\n"));