summaryrefslogtreecommitdiff
path: root/storage/connect/tabwmi.cpp
diff options
context:
space:
mode:
authorMikhail Chalov <mike.chalov@gmail.com>2022-09-28 07:45:25 -0700
committerGitHub <noreply@github.com>2022-09-28 15:45:25 +0100
commit9de9f105b5cb88249acc39af73d32af337d6fd5f (patch)
tree7f1bf919d86a80e1256ac5f6bbff469ffbbf039f /storage/connect/tabwmi.cpp
parentb2cfcf1d1f260756cceb4f19e330b4955c381f98 (diff)
downloadmariadb-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 'storage/connect/tabwmi.cpp')
-rw-r--r--storage/connect/tabwmi.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp
index f90ff98ca35..935d21c59c9 100644
--- a/storage/connect/tabwmi.cpp
+++ b/storage/connect/tabwmi.cpp
@@ -810,7 +810,7 @@ void WMICOL::ReadColumn(PGLOBAL g)
char buf[24];
int rc = VariantTimeToSystemTime(Prop.date, &stm);
- sprintf(buf, "%02d/%02d/%d %02d:%02d:%02d",
+ snprintf(buf, sizeof(buf), "%02d/%02d/%d %02d:%02d:%02d",
stm.wDay, stm.wMonth, stm.wYear,
stm.wHour, stm.wMinute, stm.wSecond);
Value->SetValue_psz(buf);