Skip to content

Commit 140e744

Browse files
Improve safety of pattern reading in appendMemoryFill()
Related-To: NEO-7233 Signed-off-by: Wrobel, Patryk <[email protected]>
1 parent 1898a82 commit 140e744

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

level_zero/core/source/cmdlist/cmdlist_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryFill(void *ptr,
15411541
return ZE_RESULT_ERROR_UNKNOWN;
15421542
}
15431543

1544-
uint32_t value = *(reinterpret_cast<uint32_t *>(const_cast<void *>(pattern)));
1544+
uint32_t value = *(reinterpret_cast<const unsigned char *>(pattern));
15451545
builtinFunction->setArgBufferWithAlloc(0, dstAllocation.alignedAllocationPtr, dstAllocation.alloc);
15461546
builtinFunction->setArgumentValue(1, sizeof(dstAllocation.offset), &dstAllocation.offset);
15471547
builtinFunction->setArgumentValue(2, sizeof(value), &value);

0 commit comments

Comments
 (0)