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)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 10 Apr 2024 22:56:33 +0000 (22:56 +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>
source4/dns_server/dnsserver_common.c

index fbe39d99bf01b94addacab6a3ef095989757cee9..0e2b25a3ee743c0947d71b9da7521459c7efa778 100644 (file)
@@ -1407,7 +1407,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 */