From: Mark Andrews Date: Thu, 28 Feb 2019 06:00:15 +0000 (+1100) Subject: Set 'specials' to match 'specials' in 'lib/dns/master.c' X-Git-Tag: v9.11.7~33^2~5 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=1a036f324fa12f42587f81e671f9bf20b499e317;p=thirdparty%2Fbind9.git Set 'specials' to match 'specials' in 'lib/dns/master.c' (cherry picked from commit 7941a9554fe00697c81b52051b41912966a1e36a) --- diff --git a/lib/dns/master.c b/lib/dns/master.c index d6e13ffe6b3..2a87bca3bc9 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -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; diff --git a/lib/dns/tests/dnstest.c b/lib/dns/tests/dnstest.c index 3658696ce7b..e0f668fef16 100644 --- a/lib/dns/tests/dnstest.c +++ b/lib/dns/tests/dnstest.c @@ -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. */