diff --git a/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp b/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp index bd3a6b8870493..0e3fca12502f9 100644 --- a/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp +++ b/unified-runtime/test/conformance/program/urProgramCreateWithBinary.cpp @@ -4,6 +4,7 @@ // // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +#include #include struct urProgramCreateWithBinaryTest : uur::urProgramTest { @@ -20,9 +21,10 @@ struct urProgramCreateWithBinaryTest : uur::urProgramTest { sizeof(binary_size), &binary_size, nullptr)); binary.resize(binary_size); - uint8_t *binary_ptr = binary.data(); + uint8_t *binary_ptr; ASSERT_SUCCESS(urProgramGetInfo(program, UR_PROGRAM_INFO_BINARIES, sizeof(binary_ptr), &binary_ptr, nullptr)); + std::memcpy(binary.data(), binary_ptr, binary_size); } void TearDown() override {