Caching an answer which has more that one RR, with at least
one answer being <=13 bytes and at least one being >13 bytes
can screw up the F_KEYTAG flag bit, resulting in the wrong
type of the address union being used and either a bad value
return or a crash in the block code.
Thanks to Dominik Derigs and the Pi-hole project for finding
and characterising this.
{
addr.rrdata.rrtype = aqtype;
addr.rrdata.datalen = (char)ardlen;
+ flags &= ~F_KEYTAG; /* in case of >1 answer, not all the same. */
if (ardlen != 0)
memcpy(addr.rrdata.data, p1, ardlen);
}