From: Douglas Bagnall Date: Sun, 7 Apr 2024 02:58:48 +0000 (+1200) Subject: ldb:sort: generalise both-NULL check to equality check X-Git-Tag: tdb-1.4.11~1041 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=531f31df99341b2cb1afc42538022451ca771983;p=thirdparty%2Fsamba.git ldb:sort: generalise both-NULL check to equality check BUG: https://bugzilla.samba.org/show_bug.cgi?id=15625 Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/modules/sort.c b/lib/ldb/modules/sort.c index a4a77329cee..72c60fc894a 100644 --- a/lib/ldb/modules/sort.c +++ b/lib/ldb/modules/sort.c @@ -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) {