mirror of
https://github.com/samba-team/samba.git
synced 2025-01-10 01:18:15 +03:00
e21251926b
If two strings are invalid UTF-8, the string is first compared with memcmp(), which compares as unsigned char. If the strings are of different lengths and one is a substring of the other, the memcmp() returns 0 and a second comparison is made which assumes the next character in the shorter string is '\0' -- but this comparison was done using SIGNED chars (on most systems). That leads to non-transitive comparisons. Consider the strings {"a\xff", "a", "ab\xff"} under that system. "a\xff" < "a", because (char)0xff == -1. "ab\xff" > "a", because 'b' == 98. "ab\xff" < "a\xff", because memcmp("ab\xff", "a\xff", 2) avoiding the signed char tiebreaker. (Before |
||
---|---|---|
.. | ||
attrib_handlers.c | ||
ldb_attributes.c | ||
ldb_controls.c | ||
ldb_debug.c | ||
ldb_dn.c | ||
ldb_ldif.c | ||
ldb_match.c | ||
ldb_modules.c | ||
ldb_msg.c | ||
ldb_options.c | ||
ldb_pack.c | ||
ldb_parse.c | ||
ldb_utf8.c | ||
ldb.c | ||
qsort.c |