Improve safety of pattern reading in appendMemoryFill()

Related-To: NEO-7233
Signed-off-by: Wrobel, Patryk <patryk.wrobel@intel.com>
This commit is contained in:
Wrobel, Patryk
2022-08-03 23:26:15 +00:00
committed by Compute-Runtime-Automation
parent 1898a82317
commit 140e744f4b

View File

@ -1541,7 +1541,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
return ZE_RESULT_ERROR_UNKNOWN;
}
uint32_t value = *(reinterpret_cast<uint32_t *>(const_cast<void *>(pattern)));
uint32_t value = *(reinterpret_cast<const unsigned char *>(pattern));
builtinFunction->setArgBufferWithAlloc(0, dstAllocation.alignedAllocationPtr, dstAllocation.alloc);
builtinFunction->setArgumentValue(1, sizeof(dstAllocation.offset), &dstAllocation.offset);
builtinFunction->setArgumentValue(2, sizeof(value), &value);