Bullanga / dns-hijack

Dns per al projecte Inite
GNU General Public License v3.0
1 stars 0 forks source link

Segfault on check_if_public_domain() #8

Closed dhap0 closed 4 years ago

dhap0 commented 4 years ago

There is a SEGFAULT on function check_if_public_domain() when req_domain is not present on either public_domains or private_domains arrays

dhap0 commented 4 years ago

_public_domainsnum variable is miscalculated and causes de fault:

for (i=0; public_domains_num; i++){
   if (0 == strcmp(req_domain, public_domains[i]))
      return 1;
}

Lines causing the error:

[src/dns.c:62]

public_domains_num = sizeof(public_domains);
private_domains_num = sizeof(private_domains);