SWDEV-561611 - fix codeql errors by increasing printf buffer sizes (#1507)
* SWDEV-561611 - fix codeql errors by increasing printf buffer sizes * Replace sprintf with snprintf to prevent potential buffer overflow --------- Co-authored-by: cadolphe-amd <chris.adolphe@amd.com>
This commit is contained in:
@@ -187,9 +187,9 @@ static void CL_CALLBACK notify_callback(const char* errinfo, const void* private
|
||||
|
||||
static void DumpTraceSI(unsigned int index, cl_ushort* tracePtr, size_t numOfBytes) {
|
||||
FILE* outFile;
|
||||
char file_name[16] = {0};
|
||||
char file_name[31] = {0};
|
||||
static unsigned int iii = 0;
|
||||
sprintf(file_name, "TTrace%d%d.out", index, iii++);
|
||||
snprintf(file_name, sizeof(file_name), "TTrace%d%d.out", index, iii++);
|
||||
|
||||
outFile = fopen(file_name, "w");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user