diff --git a/rocclr/hip_fatbin.cpp b/rocclr/hip_fatbin.cpp index b8e7c85bda..8072c18b36 100755 --- a/rocclr/hip_fatbin.cpp +++ b/rocclr/hip_fatbin.cpp @@ -64,6 +64,9 @@ hipError_t FatBinaryInfo::ExtractFatBinary(const std::vector& devi if (!amd::Os::GetFileHandle(fname_.c_str(), &fdesc_, &fsize_)) { return hipErrorFileNotFound; } + if (fsize_ == 0) { + return hipErrorInvalidKernelFile; + } // Extract the code object from file hip_error = CodeObject::ExtractCodeObjectFromFile(fdesc_, fsize_, diff --git a/rocclr/hip_platform.cpp b/rocclr/hip_platform.cpp index cc206e6cb7..03bebeb7fb 100755 --- a/rocclr/hip_platform.cpp +++ b/rocclr/hip_platform.cpp @@ -773,6 +773,9 @@ hipError_t PlatformState::getDynFunc(hipFunction_t* hfunc, hipModule_t hmod, DevLogPrintfError("Cannot find the module: 0x%x", hmod); return hipErrorNotFound; } + if (0 == strlen(func_name)) { + return hipErrorNotFound; + } return it->second->getDynFunc(hfunc, func_name); }