]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
prevent TSAN being trigged when DNS_RBTFIND_EMPTYDATA is set
authorMark Andrews <marka@isc.org>
Thu, 1 Aug 2019 21:58:36 +0000 (07:58 +1000)
committerOndřej Surý <ondrej@isc.org>
Wed, 25 Sep 2019 18:05:12 +0000 (14:05 -0400)
lib/dns/rbt.c

index b0e5a2c6e62797c0bbde949293ea3ac64720e1be..29a61fa3b65c7410bffcfed8a958d76adf0eb8fd 100644 (file)
@@ -1652,9 +1652,11 @@ dns_rbt_findnode(dns_rbt_t *rbt, const dns_name_t *name, dns_name_t *foundname,
                                /*
                                 * This might be the closest enclosing name.
                                 */
-                               if (DATA(current) != NULL ||
-                                   (options & DNS_RBTFIND_EMPTYDATA) != 0)
+                               if ((options & DNS_RBTFIND_EMPTYDATA) != 0 ||
+                                   DATA(current) != NULL)
+                               {
                                        *node = current;
+                               }
 
                                /*
                                 * Point the chain to the next level.   This
@@ -1725,8 +1727,8 @@ dns_rbt_findnode(dns_rbt_t *rbt, const dns_name_t *name, dns_name_t *foundname,
         * ISC_R_SUCCESS to indicate an exact match.
         */
        if (current != NULL && (options & DNS_RBTFIND_NOEXACT) == 0 &&
-           (DATA(current) != NULL ||
-            (options & DNS_RBTFIND_EMPTYDATA) != 0)) {
+           ((options & DNS_RBTFIND_EMPTYDATA) != 0 || DATA(current) != NULL))
+       {
                /*
                 * Found an exact match.
                 */