From: Otto Moerbeek Date: Wed, 23 Oct 2019 08:50:33 +0000 (+0200) Subject: Basic validation of $GENERATE parameters X-Git-Tag: rec-4.2.1~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8452%2Fhead;p=thirdparty%2Fpdns.git Basic validation of $GENERATE parameters (cherry picked from commit 775a673a1798d01e5e259a00cff7a757f5350f40) --- diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index 49841c4b73..c98fdd2463 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -313,6 +313,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();