fix: default initialize allocated memory when memory is overwritten

Related-To: NEO-5093

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2025-03-11 12:16:50 +00:00
committed by Compute-Runtime-Automation
parent 8ec5434460
commit a86105814d
7 changed files with 13 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2024 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -93,7 +93,7 @@ const SipKernel &BuiltIns::getSipKernel(Device &device, OsContext *context) {
UNRECOVERABLE_IF(bindlessSip.getBinary().size() == 0);
auto binarySize = alignUp(bindlessSip.getBinary().size(), sizeof(uint32_t)) / sizeof(uint32_t);
auto binary = std::make_unique<uint32_t[]>(binarySize);
auto binary = std::make_unique_for_overwrite<uint32_t[]>(binarySize);
memcpy_s(binary.get(), binarySize * sizeof(uint32_t), bindlessSip.getBinary().data(), bindlessSip.getBinary().size());
const auto allocType = AllocationType::kernelIsaInternal;