nss_dns: Fix assertion failure in _nss_dns_getcanonname_r [BZ #19865]
Commit Message
As explained in the bug, this function seems to be dead code in typical
configurations, so there does not seem to be any security impact.
Florian
Comments
On 25 Mar 2016 20:01, Florian Weimer wrote:
> As explained in the bug, this function seems to be dead code in typical
> configurations, so there does not seem to be any security impact.
lgtm
-mike
2016-03-25 Florian Weimer <fweimer@redhat.com>
[BZ #19865]
* resolv/nss_dns/dns-canon.c (_nss_dns_getcanonname_r): Restore
original buffer before retry.
@@ -154,6 +154,13 @@ _nss_dns_getcanonname_r (const char *name, char *buffer, size_t buflen,
ptr += rdatalen;
}
}
+
+ /* Restore original buffer before retry. */
+ if (ansp.ptr != buf)
+ {
+ free (ansp.ptr);
+ ansp.ptr = buf;
+ }
}
out: