From 557d2bfddf067425b81eabf55faf50e88a4eb4a7 Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 1 Sep 2016 21:34:31 -0400 Subject: [PATCH] P4 to Git Change 1310081 by lmoriche@lmoriche_opencl_dev on 2016/09/01 21:27:48 SWDEV-94610 - The spec says that the value returned for HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH does not include the NUL terminator. We should add one before using the string. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#25 edit --- rocclr/runtime/device/rocm/rocprogram.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rocclr/runtime/device/rocm/rocprogram.cpp b/rocclr/runtime/device/rocm/rocprogram.cpp index fe1264478e..a3188246ae 100644 --- a/rocclr/runtime/device/rocm/rocprogram.cpp +++ b/rocclr/runtime/device/rocm/rocprogram.cpp @@ -62,8 +62,9 @@ GetKernelNamesCallback( uint32_t len; hsa_executable_symbol_get_info(symbol, HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH, &len); - char* symName = (char*) alloca(len); + char* symName = (char*) alloca(len+1); hsa_executable_symbol_get_info(symbol, HSA_EXECUTABLE_SYMBOL_INFO_NAME, symName); + symName[len] = '\0'; std::string kernelName(symName); symNameList->push_back(kernelName);