Commit 984b3c15 authored by Sergei Petrunia's avatar Sergei Petrunia

MDEV-21341: Fix UBSAN failures, part #3

One may not call memcpy(dst, src=NULL, size), even if size==0.
parent 8b9db117
......@@ -297,7 +297,8 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
pos+= reclength;
int2store(pos, create_info->connect_string.length);
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;
int2store(pos, str_db_type.length);
pos+= 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment