]> 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 08:13:39 +0000 (18:13 +1000)
lib/dns/master.c
lib/dns/tests/dnstest.c

index 8c6541dfd7a81c29fbadc0afc25b3dfcd68bbe9e..80450f0fd7e43391dafb5462e514a5d70be21d11 100644 (file)
@@ -569,6 +569,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 d6316395cd22ef5ed0f8a5322398a11d420c64e9..dcaed957451e084685e2794c6e875374937648e9 100644 (file)
@@ -481,6 +481,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;
 
@@ -504,6 +505,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.
         */