From: Aki Tuomi Date: Mon, 8 Jan 2018 10:34:00 +0000 (+0200) Subject: pdns: RecordTextReader - trim whitespace X-Git-Tag: dnsdist-1.3.0~159^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ff7ac440afdae4370e12a1b9eb21d4b1389a861f;p=pdns pdns: RecordTextReader - trim whitespace DNS records should not care if there is whitespace around them. --- 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)