From 82ffc6cead5fb09725ce75565c5049e29d1f03e4 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Thu, 14 Sep 2017 10:08:54 +0200 Subject: [PATCH] verify parts.size(). Fixes #5688 --- pdns/pdnsutil.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 6123c9ca53..c3213712d7 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -584,16 +584,16 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vect if (rr.qtype.getCode() == QType::SRV) { vector parts; stringtok(parts, rr.getZoneRepresentation()); - toCheck = DNSName(parts[3]); + if (parts.size() == 4) toCheck = DNSName(parts[3]); } else if (rr.qtype.getCode() == QType::MX) { vector parts; stringtok(parts, rr.getZoneRepresentation()); - toCheck = DNSName(parts[1]); + if (parts.size() == 2) toCheck = DNSName(parts[1]); } else { toCheck = DNSName(rr.content); } - if (!toCheck.isHostname()) { + if (!toCheck.empty() && !toCheck.isHostname()) { cout<<"[Warning] "<