1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/lib/ldb/common
Dmitry Antipov 46ae5568fa lib:ldb: do not offset against NULL pointer in ldb_ldif_read()
Fix the following error observed running samba.test.registry
compiled with clang-17 and UBsan:

lib/ldb/common/ldb_ldif.c:881:9: runtime error: applying non-zero offset 137438953440 to null pointer
    #0 0x7faa0eb3932f in ldb_ldif_read lib/ldb/common/ldb_ldif.c:881
    #1 0x7faa0eb3aec6 in ldb_ldif_read_string lib/ldb/common/ldb_ldif.c:1004
    #2 0x7faa077ed759 in dsdb_set_schema_from_ldif source4/dsdb/schema/schema_set.c:1113
    #3 0x7faa068fcbbf in py_dsdb_set_schema_from_ldif source4/dsdb/pydsdb.c:929
    #4 0x7faa1d1d4507 in cfunction_call (/lib64/libpython3.11.so.1.0+0x1d4507)
    [... a lot of Python calls skipped...]

I.e. number of elements should be checked against zero
before making an attempt to access an element by index.

Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-05-09 01:59:32 +00:00
..
attrib_handlers.c lib:ldb:common: Fix code spelling 2023-04-04 07:31:36 +00:00
ldb_attributes.c ldb_tdb: Read from @INDEXLIST or an override if we are using a GUID index 2017-09-22 21:20:23 +02:00
ldb_controls.c lib:ldb: Fix typo 2023-03-03 01:07:36 +00:00
ldb_debug.c lib/ldb: Do not vasprintf() the tevent debug messages that will not be shown 2012-08-09 20:14:23 +10:00
ldb_dn.c lib: Save intermediate NULL checks with talloc_asprintf_addbuf() 2022-12-14 04:32:34 +00:00
ldb_ldif.c lib:ldb: do not offset against NULL pointer in ldb_ldif_read() 2023-05-09 01:59:32 +00:00
ldb_match.c CVE-2023-0614 ldb: Filter on search base before redacting message 2023-04-05 02:10:35 +00:00
ldb_modules.c lib: Use talloc_asprintf_addbuf() in ldb_module_call_chain() 2022-12-14 04:32:34 +00:00
ldb_msg.c ldb: Remove old misleading comments 2023-04-12 13:52:31 +00:00
ldb_options.c ldb: Add new internal helper function ldb_options_get() 2019-07-04 10:02:23 +00:00
ldb_pack.c ldb: Avoid undefined pointer arithmetic 2023-04-12 13:52:31 +00:00
ldb_parse.c ldb: Use correct member of union 2023-04-05 02:10:35 +00:00
ldb_utf8.c lib:ldb: Use ldb_ascii_toupper() for case folding 2022-12-23 13:23:29 +00:00
ldb.c ldb: ldb_build_search_req() check for a talloc failure 2022-09-16 05:46:35 +00:00
qsort.c ldb: Fix overflow checks 2018-04-03 20:20:10 +02:00