]> git.ipfire.org Git - thirdparty/bind9.git/commit
dns_rdataslab_merge(): use dns_rdata_compare() instead of compare_rdata()
authorMichał Kępień <michal@isc.org>
Tue, 15 May 2018 06:18:01 +0000 (08:18 +0200)
committerMichał Kępień <michal@isc.org>
Tue, 15 May 2018 07:32:19 +0000 (09:32 +0200)
commitb7b1de0a399e2891de1e22e1a5b733cecb5e02f6
tree68238bd9487470e3929a937228e4a0773219466b
parent1c875f959b48118fc8a95a28aa7955441364286e
dns_rdataslab_merge(): use dns_rdata_compare() instead of compare_rdata()

compare_rdata() was meant to be used as a qsort() callback.  Meanwhile,
dns_rdataslab_merge() calls compare_rdata() for a pair of dns_rdata_t
structures rather than a pair of struct xrdata structures, which is
harmless, but triggers an ubsan warning:

    rdataslab.c:84:33: runtime error: member access within address <address> with insufficient space for an object of type 'const struct xrdata'

Use dns_rdata_compare() instead of compare_rdata() to prevent the
warning from being triggered.

(cherry picked from commit 9bc6ba0be9447c66d8f2b055a696ff12842c7863)
lib/dns/rdataslab.c