mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
MDEV-21341: Fix UBSAN failures, part #3
One may not call memcpy(dst, src=NULL, size), even if size==0.
This commit is contained in:
parent
8b9db11718
commit
984b3c1544
1 changed files with 2 additions and 1 deletions
|
@ -297,7 +297,8 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
|
||||||
pos+= reclength;
|
pos+= reclength;
|
||||||
int2store(pos, create_info->connect_string.length);
|
int2store(pos, create_info->connect_string.length);
|
||||||
pos+= 2;
|
pos+= 2;
|
||||||
memcpy(pos, create_info->connect_string.str, create_info->connect_string.length);
|
if (create_info->connect_string.length)
|
||||||
|
memcpy(pos, create_info->connect_string.str, create_info->connect_string.length);
|
||||||
pos+= create_info->connect_string.length;
|
pos+= create_info->connect_string.length;
|
||||||
int2store(pos, str_db_type.length);
|
int2store(pos, str_db_type.length);
|
||||||
pos+= 2;
|
pos+= 2;
|
||||||
|
|
Loading…
Reference in a new issue