From ff7ac440afdae4370e12a1b9eb21d4b1389a861f Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 8 Jan 2018 12:34:00 +0200 Subject: [PATCH] pdns: RecordTextReader - trim whitespace DNS records should not care if there is whitespace around them. --- pdns/rcpgenerator.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pdns/rcpgenerator.cc b/pdns/rcpgenerator.cc index c31579f76..359009b10 100644 --- a/pdns/rcpgenerator.cc +++ b/pdns/rcpgenerator.cc @@ -28,13 +28,18 @@ #include "misc.hh" #include "utility.hh" #include +#include + #include #include "base32.hh" #include "base64.hh" #include "namespaces.hh" -RecordTextReader::RecordTextReader(const string& str, const string& zone) : d_string(str), d_zone(zone), d_pos(0), d_end(str.size()) +RecordTextReader::RecordTextReader(const string& str, const string& zone) : d_string(str), d_zone(zone), d_pos(0) { + /* remove whitespace */ + boost::trim_if(d_string, boost::algorithm::is_space()); + d_end = d_string.size(); } void RecordTextReader::xfr48BitInt(uint64_t &val) -- 2.50.1