Skip to content

Commit

Permalink
auth: Fix reading invalid iterator in fillZone()
Browse files Browse the repository at this point in the history
Reported by coverity:
```
CID 1353069 (#1 of 1): Using invalid iterator (INVALIDATE_ITERATOR)

19. deref_iterator: Dereferencing iterator rit though it is already
past the end of its container.
```
  • Loading branch information
rgacogne committed Mar 15, 2016
1 parent ef4d3ce commit 83067a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdns/ws-auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static void fillZone(const DNSName& zonename, HttpResponse* resp) {
auto cit = comments.begin();

while (rit != records.end() || cit != comments.end()) {
if (cit == comments.end() || cit->qname.toString() < rit->qname.toString() || cit->qtype < rit->qtype) {
if (cit == comments.end() || (rit != records.end() && (cit->qname.toString() < rit->qname.toString() || cit->qtype < rit->qtype)) {
current_qname = rit->qname;
current_qtype = rit->qtype;
ttl = rit->ttl;
Expand Down

0 comments on commit 83067a3

Please sign in to comment.