mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Fixed access to undefined memory found by valgrind and MSAN
When my_vsnprintf() is patched, the code protected disabled with 'WAITING_FOR_BUGFIX_TO_VSPRINTF' should be enabled again. Also all %b formats in this patch should be revert to %s again
This commit is contained in:
@ -52,8 +52,9 @@ static inline void output_core_info()
|
||||
char buff[PATH_MAX];
|
||||
ssize_t len;
|
||||
int fd;
|
||||
if ((len= readlink("/proc/self/cwd", buff, sizeof(buff))) >= 0)
|
||||
if ((len= readlink("/proc/self/cwd", buff, sizeof(buff)-1)) >= 0)
|
||||
{
|
||||
buff[len]= 0;
|
||||
my_safe_printf_stderr("Writing a core file...\nWorking directory at %.*s\n",
|
||||
(int) len, buff);
|
||||
}
|
||||
|
Reference in New Issue
Block a user