Fix env memory zeroing

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
This commit is contained in:
Rafal Stefanowski 2024-06-13 11:39:34 +02:00
parent 7c8ac29ab9
commit 5975bb8822

4
env/posix/ocf_env.h vendored
View File

@ -1,6 +1,6 @@
/*
* Copyright(c) 2019-2022 Intel Corporation
* Copyright(c) 2023 Huawei Technologies
* Copyright(c) 2023-2024 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -187,7 +187,7 @@ static inline void env_secure_free(const void *ptr, size_t size)
{
if (ptr) {
#if SECURE_MEMORY_HANDLING
memset(ptr, size, 0);
memset(ptr, 0, size);
/* TODO: flush CPU caches ? */
ENV_BUG_ON(munlock(ptr));
#endif