mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Use memory safe snprintf() in Connect Engine and elsewhere (#2210)
Continue with similar changes as done in 19af1890
to replace sprintf(buf, ...)
with snprintf(buf, sizeof(buf), ...), specifically in the "easy" cases where buf
is allocated with a size known at compile time.
All new code of the whole pull request, including one or several files that are
either new files or modified ones, are contributed under the BSD-new license. I
am contributing on behalf of my employer Amazon Web Services, Inc.
This commit is contained in:
@ -4032,7 +4032,7 @@ bool mysql_show_binlog_events(THD* thd)
|
||||
binlog_size= s.st_size;
|
||||
if (lex_mi->pos > binlog_size)
|
||||
{
|
||||
sprintf(errmsg_buf, "Invalid pos specified. Requested from pos:%llu is "
|
||||
snprintf(errmsg_buf, sizeof(errmsg_buf), "Invalid pos specified. Requested from pos:%llu is "
|
||||
"greater than actual file size:%lu\n", lex_mi->pos,
|
||||
(ulong)s.st_size);
|
||||
errmsg= errmsg_buf;
|
||||
|
Reference in New Issue
Block a user