From: Peter van Dijk Date: Mon, 14 Mar 2016 15:01:24 +0000 (+0100) Subject: strip all types of whitespace from around content while parsing zones, fixes #3568 X-Git-Tag: dnsdist-1.0.0-beta1~99^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=06918967c57f67da44a2b9699205c347ade2cf96;p=pdns strip all types of whitespace from around content while parsing zones, fixes #3568 --- diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index 3ac6081f6..7f7aa872c 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -401,6 +401,7 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment) } } } + trim_if(rr.content, is_any_of(" \r\n\x1a")); vector recparts; switch(rr.qtype.getCode()) { diff --git a/regression-tests.nobackend/tinydns-data-check/expected_result b/regression-tests.nobackend/tinydns-data-check/expected_result index fdacbfa03..05c83a9e9 100644 --- a/regression-tests.nobackend/tinydns-data-check/expected_result +++ b/regression-tests.nobackend/tinydns-data-check/expected_result @@ -1,4 +1,4 @@ -59a3777d58479963df0a39c8c27061dc ../regression-tests/zones/example.com +ac480efeccfd43a434fee71375ca88bc ../regression-tests/zones/example.com b4feb02bd50f7b78cd5c40c7a560019c ../regression-tests/zones/test.com 005b3381db2a7dc70b690484f6ab7770 ../regression-tests/zones/test.dyndns 0861783f9f83acd9044278cda2528ee2 ../regression-tests/zones/wtest.com diff --git a/regression-tests/zones/example.com b/regression-tests/zones/example.com index 25f05f667..4d0126a64 100644 --- a/regression-tests/zones/example.com +++ b/regression-tests/zones/example.com @@ -86,7 +86,9 @@ smtp1 IN CNAME outpost ; external-mail IN MX 25 server1.test.com. ; -text IN TXT "Hi, this is some text" +text IN TXT ( + "Hi, this is some text" + ) multitext IN TXT "text part one" "text part two" "text part three" escapedtext IN TXT "begin" "the \"middle\" p\\art" "the end" text0 IN TXT "k=rsa; p=one"