1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-35688 UBSAN: SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-offset in my_casedn_utf8mb3

The functions MY_CHARSET_HANDLER::caseup() and MY_CHARSET_HANDLER::casedn()
in their virtual imlementations do "const char *end= src + srclen"
in the very beginning. Therefore src cannot be NULL to avoid
"UBSAN: SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-offset".

Adding DBUG_ASSERT(src != NULL) into all virtual implementations,
to catch this problem in regular Debug builds (without UBSAN).

Fixing Master_info_index::get_master_info() to check connection_name->str.
If it is NULL then passing empty_clex_str into IdentBufferCasedn
instead of *connection_name.
This commit is contained in:
Alexander Barkov
2025-01-20 19:53:25 +04:00
parent 6be42c7276
commit c1559f261f
8 changed files with 31 additions and 1 deletions

View File

@@ -43,3 +43,9 @@ SELECT @@GLOBAL.replicate_do_db;
# Cleanup.
SET @@GLOBAL.replicate_do_db = @save_replicate_do_db;
#
# MDEV-35688 UBSAN: SUMMARY: UndefinedBehaviorSanitizer: nullptr-with-offset in my_casedn_utf8mb3
#
show variables like 'replicate_do_db';
Variable_name Value
replicate_do_db