• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 19957761886

05 Dec 2025 08:52AM UTC coverage: 73.063% (-0.07%) from 73.131%
19957761886

push

github

web-flow
Merge pull request #16590 from rgacogne/ddist-coverity-20251204

dnsdist: Fix missed optimizations reported by Coverity in config

38511 of 63422 branches covered (60.72%)

Branch coverage included in aggregate %.

3 of 5 new or added lines in 1 file covered. (60.0%)

13941 existing lines in 122 files now uncovered.

128037 of 164529 relevant lines covered (77.82%)

5473411.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

96.15
/pdns/bindparserclasses.hh
1
/*
2
 * This file is part of PowerDNS or dnsdist.
3
 * Copyright -- PowerDNS.COM B.V. and its contributors
4
 *
5
 * This program is free software; you can redistribute it and/or modify
6
 * it under the terms of version 2 of the GNU General Public License as
7
 * published by the Free Software Foundation.
8
 *
9
 * In addition, for the avoidance of any doubt, permission is granted to
10
 * link this program with OpenSSL and to (re)distribute the binaries
11
 * produced as the result of such linking.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
 */
22
#pragma once
23
#include <string>
24
#include <map>
25
#include <vector>
26
#include <set>
27
#include <stdio.h>
28
#include <sys/stat.h>
29

30
#include "namespaces.hh"
31
#include "iputils.hh"
32

33
class BindDomainInfo 
34
{
35
public:
36
  void clear() 
37
  {
3,265✔
38
    name=ZoneName();
3,265✔
39
    filename=type="";
3,265✔
40
    primaries.clear();
3,265✔
41
    alsoNotify.clear();
3,265✔
42
    d_dev=0;
3,265✔
43
    d_ino=0;
3,265✔
44
  }
3,265✔
45
  ZoneName name;
46
  string viewName;
47
  string filename;
48
  vector<ComboAddress> primaries;
49
  set<string> alsoNotify;
50
  string type;
51
  bool hadFileDirective{false};
52

53
  dev_t d_dev{0};
54
  ino_t d_ino{0};
55

56
  bool operator<(const BindDomainInfo& b) const
57
  {
11,822✔
58
    return pair(d_dev, d_ino) < pair(b.d_dev, b.d_ino);
11,822✔
59
  }
11,822✔
60
};
61

62
extern const char *bind_directory;
63
extern FILE *yyin;
64
class BindParser
65
{
66
 public:
67
   BindParser()
68
   {
376✔
69
     yyin = 0;
376✔
70
     extern int include_stack_ptr;
376✔
71
     include_stack_ptr = 0;
376✔
72

73
     bind_directory = d_dir.c_str();
376✔
74
   }
376✔
75
  ~BindParser()
76
  {
376✔
77
    if(yyin) {
376!
78
      fclose(yyin);
376✔
79
      yyin=0;
376✔
80
    }
376✔
81
  }
376✔
82
  void parse(const string &fname);
83
  void commit(BindDomainInfo DI);
84
  void setDirectory(const string &dir);
85
  const string &getDirectory();
86
  const vector<BindDomainInfo>& getDomains();
87
  void setVerbose(bool verbose);
88
  void addAlsoNotify(const string &host);
UNCOV
89
  set<string> & getAlsoNotify() { return this->alsoNotify; } 
311✔
90
private:
91
  string d_dir{"."};
92
  set<string> alsoNotify;
93
  vector<BindDomainInfo> d_zonedomains;
94
  bool d_verbose{false};
95
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc