Set 'specials' to match 'specials' in 'lib/dns/master.c'

(cherry picked from commit 7941a9554f)
This commit is contained in:
Mark Andrews
2019-04-11 19:51:05 +10:00
parent 2c5652067f
commit 1a036f324f
2 changed files with 16 additions and 0 deletions
+4
View 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;
+12
View 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.
*/