]> granicus.if.org Git - pdns/commitdiff
Basic validation of $GENERATE parameters
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 23 Oct 2019 08:50:33 +0000 (10:50 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 23 Oct 2019 09:53:20 +0000 (11:53 +0200)
(cherry picked from commit 775a673a1798d01e5e259a00cff7a757f5350f40)

pdns/zoneparser-tng.cc

index 49841c4b7308a913c61b9440353996b4be5d38d6..c98fdd246307cc56ef2d5bf9238f591d13036516 100644 (file)
@@ -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();