mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +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 |
||
---|---|---|
.. | ||
ABI | ||
common | ||
docs | ||
examples | ||
include | ||
ldb_key_value | ||
ldb_ldap | ||
ldb_ldb | ||
ldb_map | ||
ldb_mdb | ||
ldb_sqlite3 | ||
ldb_tdb | ||
man | ||
modules | ||
nssldb | ||
tests | ||
tools | ||
web | ||
_ldb_text.py | ||
configure | ||
Doxyfile | ||
examples.dox | ||
ldb.pc.in | ||
mainpage.dox | ||
Makefile | ||
pyldb_util.c | ||
pyldb-util.pc.in | ||
pyldb.c | ||
pyldb.h | ||
README_gcov.txt | ||
wscript |