From 962dd24e6b1ec5f46589f713f83ac453b066be74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Thu, 26 Sep 2024 18:42:48 +0200 Subject: [PATCH] fix(Foundation): Poco::Placeholder initialization uses wrong size (#4711) --- Foundation/include/Poco/Any.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Foundation/include/Poco/Any.h b/Foundation/include/Poco/Any.h index 00673863d8..e05d81f13e 100644 --- a/Foundation/include/Poco/Any.h +++ b/Foundation/include/Poco/Any.h @@ -80,7 +80,7 @@ union Placeholder Placeholder(): pHolder(0) { - std::memset(holder, 0, sizeof(Placeholder)); + std::memset(holder, 0, sizeof(holder)); } ~Placeholder() @@ -101,8 +101,8 @@ union Placeholder bool isEmpty() const { - static char buf[SizeV+1] = {}; - return 0 == std::memcmp(holder, buf, SizeV+1); + static char buf[sizeof(holder)] = {}; + return 0 == std::memcmp(holder, buf, sizeof(holder)); } bool isLocal() const @@ -156,7 +156,7 @@ union Placeholder else reinterpret_cast(holder)->~PlaceholderT(); - if (clear) std::memset(holder, 0, sizeof(Placeholder)); + if (clear) std::memset(holder, 0, sizeof(holder)); } }