From bb93a976d4b7b52876f970e537b82e18dd0d7547 Mon Sep 17 00:00:00 2001 From: Jatin Chaudhary Date: Tue, 12 Dec 2023 00:06:38 +0000 Subject: [PATCH] SWDEV-430619 - copy uuid via memcpy If uuid is copied via strncpy it will stop at first null character. We need to copy all 16 bytes which might have a null on windows. Change-Id: I8667919cb251133eec3333a23768c356879727e8 [ROCm/clr commit: db909b2a1ee3699cbce20b20d26745d1326b2fad] --- projects/clr/hipamd/src/hip_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_device.cpp b/projects/clr/hipamd/src/hip_device.cpp index b617d2cf0b..9344dc7cff 100644 --- a/projects/clr/hipamd/src/hip_device.cpp +++ b/projects/clr/hipamd/src/hip_device.cpp @@ -291,7 +291,7 @@ hipError_t ihipGetDeviceProperties(hipDeviceProp_tR0600* props, int device) { const auto& info = deviceHandle->info(); const auto& isa = deviceHandle->isa(); ::strncpy(deviceProps.name, info.boardName_, sizeof(info.boardName_)); - ::strncpy(deviceProps.uuid.bytes, info.uuid_, sizeof(info.uuid_)); + memcpy(deviceProps.uuid.bytes, info.uuid_, sizeof(info.uuid_)); deviceProps.totalGlobalMem = info.globalMemSize_; deviceProps.sharedMemPerBlock = info.localMemSizePerCU_; deviceProps.sharedMemPerMultiprocessor = info.localMemSizePerCU_ * info.numRTCUs_;