I tried to reason on commit message why memcpy() is safe on those cases but maybe it was not clear. So we have:
memcpy(old_name_cs_filename, old_name, MAX_TABLE_NAME_LEN);
|
instead of strncpy() and used strings are defined on same functions as
char old_name[MAX_FULL_NAME_LEN + 1];
|
char old_name_cs_filename[MAX_TABLE_NAME_LEN+20];
|
And #define MAX_FULL_NAME_LEN (MAX_TABLE_NAME_LEN + MAX_DATABASE_NAME_LEN + 14) that
is larger than MAX_TABLE_NAME_LEN in both cases. To avoid reading uninitialized memory we should
zero-initialize those strings.
I did not add any zero-initialization on latest version, they were there already, maybe they are unnecessary. I do not think real string truncation is possible.
http://lists.askmonty.org/pipermail/commits/2019-February/013446.html