diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2019-12-18 13:11:07 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2019-12-18 13:11:07 +0300 |
commit | 984b3c15449e0b5c7b3d66047a3c490c7be40faf (patch) | |
tree | 3f57d4f6495673b98456b92a02af4f299f5ccacd /sql/unireg.cc | |
parent | 8b9db11718af0c61e8d3cdbb634cf273b8998f98 (diff) | |
download | mariadb-git-984b3c15449e0b5c7b3d66047a3c490c7be40faf.tar.gz |
MDEV-21341: Fix UBSAN failures, part #3
One may not call memcpy(dst, src=NULL, size), even if size==0.
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index b9abe3da1b9..b116218b60e 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -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; |