mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
Use correct destination size when copying device name
This change: - corrects the size of destination buffer and sets it to ZE_MAX_DEVICE_NAME - ensures that copied name is null-terminated Signed-off-by: Patryk Wrobel <patryk.wrobel@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
788240c8ba
commit
340b578248
@@ -754,7 +754,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
|
||||
} else if (driverInfo) {
|
||||
name.assign(driverInfo->getDeviceName(name).c_str());
|
||||
}
|
||||
memcpy_s(pDeviceProperties->name, name.length(), name.c_str(), name.length());
|
||||
memcpy_s(pDeviceProperties->name, ZE_MAX_DEVICE_NAME, name.c_str(), name.length() + 1);
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user