mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Fix 5846f749e5
Not sure how that bug got in there. Very (un)lucky choice of test data, or last-minute "it'll be fine" modification I guess. It was late, I can't remember. Thanks to Dominik Derrigs for spotting the problem.
This commit is contained in:
@@ -137,12 +137,12 @@ static struct hostsfile *dyndir_addhosts(struct dyndir *dd, char *file)
|
|||||||
{
|
{
|
||||||
/* Check if this file is already known in dd->files */
|
/* Check if this file is already known in dd->files */
|
||||||
struct hostsfile *ah;
|
struct hostsfile *ah;
|
||||||
size_t dirlen = sizeof(dd->dname);
|
size_t dirlen = strlen(dd->dname);
|
||||||
|
|
||||||
/* ah->fname always starts with the string in dd->dname */
|
/* ah->fname always starts with the string in dd->dname */
|
||||||
for (ah = dd->files; ah; ah = ah->next)
|
for (ah = dd->files; ah; ah = ah->next)
|
||||||
if (ah->fname[dirlen+2] == '/' &&
|
if (ah->fname[dirlen] == '/' &&
|
||||||
strcmp(&ah->fname[dirlen+3], file) == 0)
|
strcmp(&ah->fname[dirlen+1], file) == 0)
|
||||||
return ah;
|
return ah;
|
||||||
|
|
||||||
/* Not known, create new hostsfile record for this dyndir */
|
/* Not known, create new hostsfile record for this dyndir */
|
||||||
|
|||||||
Reference in New Issue
Block a user