Commit 6941c778 authored by Xiao Lei's avatar Xiao Lei Committed by gbsbuild

Change strcpy to strcpy_s for safe copy

Change-Id: Ia65644a01366cfd135197e3c512c6f0d15d627c1
parent ce8da10c
......@@ -4248,7 +4248,7 @@ void CEncoder::CreateFunctionSymbolTable(void*& buffer, unsigned& bufferSize, un
for (auto pFunc : funcsToExport)
{
assert(pFunc->getName().size() <= IGC::MAX_SYMBOL_NAME_LENGTH);
strcpy(entry_ptr->s_name, pFunc->getName().str().c_str());
strcpy_s(entry_ptr->s_name, IGC::MAX_SYMBOL_NAME_LENGTH, pFunc->getName().str().c_str());
if (pFunc->isDeclaration())
{
......
......@@ -8083,7 +8083,7 @@ int VISAKernelImpl::GetGenRelocEntryBuffer(void *&buffer, unsigned int &byteSize
buffer_p->r_type = reloc.getType();
buffer_p->r_offset = (uint32_t)reloc.getInst()->getGenOffset();
assert(reloc.getSymbolName().size() <= IGC::MAX_SYMBOL_NAME_LENGTH);
std::strcpy(buffer_p->r_symbol, reloc.getSymbolName().c_str());
strcpy_s(buffer_p->r_symbol, IGC::MAX_SYMBOL_NAME_LENGTH, reloc.getSymbolName().c_str());
++buffer_p;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment