While investigating crash mentioned in #24,
It seems like here:
|
dnptrs[0] = (unsigned char *)&pkt; |
We are passing a pointer to the entire pkt struct (header and data). This allows dn_comp to occasionally muck with the pkt header. We should be passing a pointer to just the buffer (pkt.data).
On a tangent, since MAX_NAME_LEN is always used for the length check (regardless of the name length) the effectively max length of the data buffer is around 900 bytes. Which should be enough for most cases but does mean 90% of the allocated space will go unused.
While investigating crash mentioned in #24,
It seems like here:
mdnsd/dns.c
Line 90 in 2f75344
We are passing a pointer to the entire
pktstruct (header and data). This allowsdn_compto occasionally muck with the pkt header. We should be passing a pointer to just the buffer (pkt.data).On a tangent, since
MAX_NAME_LENis always used for the length check (regardless of the name length) the effectively max length of the data buffer is around 900 bytes. Which should be enough for most cases but does mean 90% of the allocated space will go unused.