Commit Diff
Diff:
382c1ee399ef503bcf9e2af747718d39a64b4d88
99d7224d087fbe1ba2ceb4358851f11025929492
Commit:
99d7224d087fbe1ba2ceb4358851f11025929492
Tree:
dd4a7226e218269abd0a65d82cec9c3708f9a418
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Wed Sep 6 04:20:23 2017 UTC
Message:
in find_next_closer_nsec3() if we cannot find the next closer hash in our TAILQ then return with the last member. This was unearthed by a stranger in my logs with the query for dubist.dtschland.eu. also plug a possible memory leak.
blob - edf816a46b2fc6ba6c86dda43c87b722a2decae0
blob + 30c71c649c5b0e9ac60319213042b301409999cb
--- dnssec.c
+++ dnssec.c
@@ -193,7 +193,9 @@ find_next_closer_nsec3(char *zonename, int zonelen, ch
}
if (n3 == NULL) {
- return NULL;
+ /* returning NULL is not recommended here */
+ ns3p = TAILQ_LAST(&dnp->nsec3head, a);
+ return (ns3p->domainname);
}
#if DEBUG
@@ -1141,8 +1143,10 @@ find_nsec3_cover_next_closer(char *name, int namelen,
}
ncn = find_next_closer_name(name, namelen, sd0->zone, sd0->zonelen, &ncnlen);
- if (ncn == NULL)
+ if (ncn == NULL) {
+ free(sd0);
return NULL;
+ }
hashname = hash_name(ncn, ncnlen, &n3p->nsec3param);
if (hashname == NULL) {
repomaster@centroid.eu