git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ba6fcb
)
s3:libsmb:nmblib: use NUMERIC_CMP in status_compare
author
Douglas Bagnall
<douglas.bagnall@catalyst.net.nz>
Mon, 8 Apr 2024 05:08:03 +0000
(17:08 +1200)
committer
Andrew Bartlett
<abartlet@samba.org>
Tue, 23 Apr 2024 01:33:29 +0000
(
01:33
+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>
source3/libsmb/nmblib.c
patch
|
blob
|
history
diff --git
a/source3/libsmb/nmblib.c
b/source3/libsmb/nmblib.c
index 232b80039734921299d1e54baca3b74c3dbeda77..2297dd9ded948f9a2c6281fd939d8c4ff9f19e34 100644
(file)
--- a/
source3/libsmb/nmblib.c
+++ b/
source3/libsmb/nmblib.c
@@
-1235,8
+1235,10
@@
static unsigned char sort_ip[4];
static int name_query_comp(unsigned char *p1, unsigned char *p2)
{
- return matching_len_bits(p2+2, sort_ip, 4) -
- matching_len_bits(p1+2, sort_ip, 4);
+ int a = matching_len_bits(p1+2, sort_ip, 4);
+ int b = matching_len_bits(p2+2, sort_ip, 4);
+ /* reverse sort -- p2 derived value comes first */
+ return NUMERIC_CMP(b, a);
}
/****************************************************************************