]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4: use numeric_cmp in dns_common_sort_zones()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 2 Apr 2024 23:55:54 +0000 (12:55 +1300)
committerJule Anger <janger@samba.org>
Mon, 10 Jun 2024 13:25:16 +0000 (13:25 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit ee4ebcccd7d9d89dda59615b3653df2632fb1a5d)

source4/dns_server/dnsserver_common.c

index 0481b0715c7f08a9e5665511ed2c3aeb3580d02a..0bbba7ff6de3f0cafab6aaea3f910afc0bc8da48 100644 (file)
@@ -1402,7 +1402,7 @@ static int dns_common_sort_zones(struct ldb_message **m1, struct ldb_message **m
        /* If the string lengths are not equal just sort by length */
        if (l1 != l2) {
                /* If m1 is the larger zone name, return it first */
-               return l2 - l1;
+               return NUMERIC_CMP(l2, l1);
        }
 
        /*TODO: We need to compare DNs here, we want the DomainDNSZones first */