Skip to content

Commit

Permalink
Merge pull request #445 from pi-hole/hotfix/v4.1.2
Browse files Browse the repository at this point in the history
Fix segfault in FTL_reply corresponding to name being null
  • Loading branch information
Jacob Salmela authored Dec 21, 2018
2 parents f5f331b + ab9dc6e commit b06eedf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dnsmasq_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ void FTL_reply(unsigned short flags, char *name, struct all_addr *addr, int id)
// Determine if this reply is an exact match for the queried domain
int domainID = queries[i].domainID;
validate_access("domains", domainID, true, __LINE__, __FUNCTION__, __FILE__);
bool isExactMatch = (strcmp(domains[domainID].domain, name) == 0);
bool isExactMatch = (name != NULL && strcmp(domains[domainID].domain, name) == 0);

if((flags & F_CONFIG) && isExactMatch && !queries[i].complete)
{
Expand Down

0 comments on commit b06eedf

Please sign in to comment.