1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-05 09:18:06 +03:00
samba-mirror/lib/ldb
Douglas Bagnall c49c48afe0 ldb:utf8: ldb_ascii_toupper() avoids real toupper()
If a non-lowercase ASCII character has an uppercase counterpart in
some locale, toupper() will convert it to an int codepoint. Probably
that codepoint is too big to fit in our char return type, so we would
truncate it to 8 bit. So it becomes an arbitrary mapping.

It would also behave strangely with a byte with the top bit set, say
0xE2. If char is unsigned on this system, that is 'â', which
uppercases to 'Â', with the codepoint 0xC2. That seems fine in
isolation, but remember this is ldb_utf8.c, and that byte was not a
codepoint but a piece of a long utf-8 encoding. In the more likely
case where char is signed, toupper() is being passed a negative
number, the result of which is undefined.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Apr 23 02:37:25 UTC 2024 on atb-devel-224
2024-04-23 02:37:25 +00:00
..
ABI pyldb: Include a reference to the Ldb in objects that use 2024-04-10 05:13:32 +00:00
common ldb:utf8: ldb_ascii_toupper() avoids real toupper() 2024-04-23 02:37:25 +00:00
docs lib:ldb: Reformat shell scripts 2022-02-24 09:15:34 +00:00
examples
include ldb: add NUMERIC_CMP macro to ldb.h 2024-04-10 22:56:33 +00:00
ldb_key_value ldb: Fix code spelling 2023-10-25 22:23:37 +00:00
ldb_ldap ldb_ldap: Fix a memleak 2020-07-02 10:38:34 +00:00
ldb_ldb ldb: Add MDB support to ldb:// 2018-05-23 02:27:12 +02:00
ldb_map ldb: Use correct member of union 2023-04-05 02:10:35 +00:00
ldb_mdb lib:ldb: Fix code spelling 2023-04-11 09:06:35 +00:00
ldb_sqlite3 ldb:ldb_sqlite3: Access correct member of union 2023-08-14 04:57:34 +00:00
ldb_tdb ldb: Fix code spelling 2023-10-25 22:23:37 +00:00
man lib:ldb: Fix code spelling 2023-04-11 09:06:35 +00:00
modules ldb:sort: generalise both-NULL check to equality check 2024-04-23 01:33:29 +00:00
nssldb lib:ldb:nssldb: Fix code spelling 2023-04-04 07:31:36 +00:00
tests ldb:pytests: test for Turkic i-dots in ldb_comparison_fold 2024-04-23 01:33:29 +00:00
tools ldb: Fix building with FORTIFY_SOURCE=2 2023-10-01 22:45:38 +00:00
web
_ldb_text.py ldb/tests/_ldb_text: remove unused imports 2018-10-25 21:45:55 +02:00
Doxyfile
examples.dox
ldb.pc.in lib/ldb: Adapt pkg-config files to being build from the main build. 2024-03-01 02:41:37 +00:00
mainpage.dox
pyldb_util.c pyldb: Include a reference to the Ldb in objects that use 2024-04-10 05:13:32 +00:00
pyldb-util.pc.in lib/ldb: Adapt pkg-config files to being build from the main build. 2024-03-01 02:41:37 +00:00
pyldb.c ldb: Check result of py_ldb_msg_keys() 2024-04-21 22:10:35 +00:00
pyldb.h ldb:pyldb: reorder structs for possible type-punning 2024-04-10 05:13:32 +00:00
README_gcov.txt
wscript build: Allow --with-ldbmodulesdir to override location of LDB modules 2024-03-01 02:41:37 +00:00