]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
gensec: sort_gensec uses NUMERIC_CMP
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 7 Apr 2024 03:54:02 +0000 (15:54 +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 acaa1323d0337ae9339dfff9f856ea54725a86ac)

auth/gensec/gensec_start.c

index b6979812ac0eeeefff6bfaaa41dc7a6eaf29aab1..4511674c8ebecd5dd77175e194819864940f126c 100644 (file)
@@ -1103,7 +1103,7 @@ _PUBLIC_ const struct gensec_critical_sizes *gensec_interface_version(void)
 }
 
 static int sort_gensec(const struct gensec_security_ops **gs1, const struct gensec_security_ops **gs2) {
-       return (*gs2)->priority - (*gs1)->priority;
+       return NUMERIC_CMP((*gs2)->priority, (*gs1)->priority);
 }
 
 int gensec_setting_int(struct gensec_settings *settings, const char *mechanism, const char *name, int default_value)