[ldns-users] trailing garbage in wire parser

Jelte Jansen jelte at isc.org
Sun Sep 6 12:17:09 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

robert edmonds brought to my attention something that might or might not be a
problem in ldns; the wire parser does not error if there is trailing garbage
after a dns packet. One could very well say that that is not supposed to happen
and an error should be raised.

Here's a small patch that does that. Although even if included, there is one
more choice to be made; should the packet be freed and NULL returned, or should
the packet be kept in case the one asking for the parsing still wants to have
it? (depends on whether callers check for *pkt == NULL or return value ==
LDNS_STATUS_OK to decide whether or not the pkt should be free'd later, i think
both ways are used by developers) It now does the latter, but freeing it is
probably more consistent, if an error is returned.

Jelte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqjqEUACgkQ4nZCKsdOncV84gCgju4+UjiRAwRLZ/R3oOZz97jm
amQAn0u2lY4jFzo52iqkP7rQV3+7ov5q
=8zK+
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ldns_trailing_garbage.patch
Type: text/x-diff
Size: 496 bytes
Desc: not available
URL: <http://lists.nlnetlabs.nl/pipermail/ldns-users/attachments/20090906/e9ecea73/attachment.bin>


More information about the ldns-users mailing list