Skip to content

Commit

Permalink
Merge pull request #62 from jelu/dnsmsginit
Browse files Browse the repository at this point in the history
Fix #61: Make sure variables are initialized
  • Loading branch information
jelu authored Nov 9, 2017
2 parents 7c4fbeb + 6a790e6 commit c3179c3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/dns.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ class DNSMessage {
char qname[0x2000];
int qtype;
int qclass;

Question()
{
qname[0] = 0;
qtype = 0;
qclass = 0;
}

int parse(DNSMessage& m, int offs)
{
offs = m.parse_dname(qname, sizeof(qname), offs);
Expand All @@ -136,6 +144,16 @@ class DNSMessage {
int rdlength;
int doffs;

RR()
{
name[0] = 0;
type = 0;
rr_class = 0;
ttl = 0;
rdlength = 0;
doffs = 0;
}

int parse(DNSMessage& m, int offs)
{
offs = m.parse_dname(name, sizeof(name), offs);
Expand Down

0 comments on commit c3179c3

Please sign in to comment.