]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb:sort: generalise both-NULL check to equality check
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 7 Apr 2024 02:58:48 +0000 (14:58 +1200)
committerJule Anger <janger@samba.org>
Mon, 10 Jun 2024 13:25:17 +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 531f31df99341b2cb1afc42538022451ca771983)

lib/ldb/modules/sort.c

index a4a77329ceec752f4c2906532527a03edffd7d19..72c60fc894a96789857c39e99657e551429b97f7 100644 (file)
@@ -125,7 +125,7 @@ static int sort_compare(struct ldb_message **msg1, struct ldb_message **msg2, vo
         * NULL and empty elements sort at the end (regardless of ac->reverse flag).
         * NULL elements come after empty ones.
         */
-       if (el1 == NULL && el2 == NULL) {
+       if (el1 == el2) {
                return 0;
        }
        if (el1 == NULL) {