diff options
author | Mikhail Chalov <mike.chalov@gmail.com> | 2022-09-28 07:45:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-28 15:45:25 +0100 |
commit | 9de9f105b5cb88249acc39af73d32af337d6fd5f (patch) | |
tree | 7f1bf919d86a80e1256ac5f6bbff469ffbbf039f /sql/sql_repl.cc | |
parent | b2cfcf1d1f260756cceb4f19e330b4955c381f98 (diff) | |
download | mariadb-git-9de9f105b5cb88249acc39af73d32af337d6fd5f.tar.gz |
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.
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 7d1ddc08aaa..c52f0ab1ae9 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -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; |