diff --git a/projects/rocr-runtime/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp b/projects/rocr-runtime/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp index 3862f8159a..9e49ba9d53 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/libamdhsacode/amd_hsa_code.cpp @@ -145,6 +145,9 @@ namespace code { } case HSA_CODE_SYMBOL_INFO_MODULE_NAME: { std::string ModuleName = GetModuleName(); + if (!value) { + return HSA_STATUS_ERROR_INVALID_ARGUMENT; + } memset(value, 0x0, ModuleName.size()); memcpy(value, ModuleName.c_str(), ModuleName.size()); break;