Skip to content

Commit

Permalink
fix(Foundation): Poco::Placeholder initialization uses wrong size (#4711
Browse files Browse the repository at this point in the history
)
  • Loading branch information
obiltschnig committed Sep 26, 2024
1 parent 072e980 commit 962dd24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Foundation/include/Poco/Any.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ union Placeholder

Placeholder(): pHolder(0)
{
std::memset(holder, 0, sizeof(Placeholder));
std::memset(holder, 0, sizeof(holder));
}

~Placeholder()
Expand All @@ -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
Expand Down Expand Up @@ -156,7 +156,7 @@ union Placeholder
else
reinterpret_cast<PlaceholderT*>(holder)->~PlaceholderT();

if (clear) std::memset(holder, 0, sizeof(Placeholder));
if (clear) std::memset(holder, 0, sizeof(holder));
}
}

Expand Down

0 comments on commit 962dd24

Please sign in to comment.