Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory access out of bounds #209

Merged
merged 3 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions native/src/seal/util/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace seal
{
namespace util
{
void seal_memzero(void *const data, const size_t size)
void seal_memzero(void *const data, size_t size)
{
#if SEAL_SYSTEM == SEAL_SYSTEM_WINDOWS
SecureZeroMemory(data, size);
Expand All @@ -33,8 +33,7 @@ namespace seal
explicit_memset(data, 0, size);
#else
volatile SEAL_BYTE *data_ptr = reinterpret_cast<SEAL_BYTE *>(data);
size_t i = 0;
while (i < size)
while (size--)
{
*data_ptr++ = static_cast<SEAL_BYTE>(0);
}
Expand Down
2 changes: 1 addition & 1 deletion native/src/seal/util/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,6 @@ namespace seal
return value == T{ 0 };
}

void seal_memzero(void *const data, const std::size_t size);
void seal_memzero(void *const data, std::size_t size);
} // namespace util
} // namespace seal