]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Set 'specials' to match 'specials' in 'lib/dns/master.c'
authorMark Andrews <marka@isc.org>
Thu, 28 Feb 2019 06:00:15 +0000 (17:00 +1100)
committerMark Andrews <marka@isc.org>
Thu, 11 Apr 2019 09:51:05 +0000 (19:51 +1000)
(cherry picked from commit 7941a9554fe00697c81b52051b41912966a1e36a)

lib/dns/master.c
lib/dns/tests/dnstest.c

index d6e13ffe6b3f119200e626b6f123b61114477e4e..2a87bca3bc9909cd345dc2c17adc25176b1a9bf0 100644 (file)
@@ -574,6 +574,10 @@ loadctx_create(dns_masterformat_t format, isc_mem_t *mctx,
                if (result != ISC_R_SUCCESS)
                        goto cleanup_inc;
                lctx->keep_lex = false;
+               /*
+                * If specials change update dns_test_rdatafromstring()
+                * in lib/dns/tests/dnstest.c.
+                */
                memset(specials, 0, sizeof(specials));
                specials[0] = 1;
                specials['('] = 1;
index 3658696ce7b5c0b454f633b34424a1120f7bc910..e0f668fef1667f98f8a92a6e18a6dbb923de57b8 100644 (file)
@@ -510,6 +510,7 @@ dns_test_rdatafromstring(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
        dns_rdatacallbacks_t callbacks;
        isc_buffer_t source, target;
        isc_lex_t *lex = NULL;
+       isc_lexspecials_t specials = { 0 };
        isc_result_t result;
        size_t length;
 
@@ -533,6 +534,17 @@ dns_test_rdatafromstring(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
                return (result);
        }
 
+       /*
+        * Set characters which will be treated as valid multi-line RDATA
+        * delimiters while reading the source string.  These should match
+        * specials from lib/dns/master.c.
+        */
+       specials[0] = 1;
+       specials['('] = 1;
+       specials[')'] = 1;
+       specials['"'] = 1;
+       isc_lex_setspecials(lex, specials);
+
        /*
         * Point lexer at source.
         */