P4 to Git Change 1772349 by mshivama@mshivama_tf on 2019/04/20 07:35:24
SWDEV-187020 - Basic "Hello World" Tensorflow program fails to execute on HIP/VDI/PAL/LINUX Make sure that the size of `dest` is big enough to hoid `src` including trailing zero byte Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_device.cpp#19 edit
Esse commit está contido em:
@@ -118,11 +118,13 @@ hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device) {
|
||||
const auto& info = deviceHandle->info();
|
||||
const auto nameLen = ::strlen(info.boardName_);
|
||||
|
||||
if (nameLen > (cl_uint)len) {
|
||||
// Make sure that the size of `dest` is big enough to hold `src` including
|
||||
// trailing zero byte
|
||||
if (nameLen > (cl_uint)(len - 1)) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
::strncpy(name, info.boardName_, nameLen);
|
||||
::strncpy(name, info.boardName_, (nameLen + 1));
|
||||
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário