From: Otto Moerbeek Date: Wed, 23 Oct 2019 08:50:33 +0000 (+0200) Subject: Basic validation of $GENERATE parameters X-Git-Tag: dnsdist-1.4.0-rc4~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8451%2Fhead;p=thirdparty%2Fpdns.git Basic validation of $GENERATE parameters --- diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index 7ac0c5fe64..5c4ed00db2 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -324,6 +324,10 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment) d_templatestep=1; d_templatestop=0; sscanf(range.c_str(),"%u-%u/%u", &d_templatecounter, &d_templatestop, &d_templatestep); + if (d_templatestep < 1 || + d_templatestop < d_templatecounter) { + throw exception("Illegal $GENERATE parameters"); + } d_templateline=d_line; parts.pop_front(); parts.pop_front();