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:
@@ -261,8 +261,8 @@ void OCLPerfMatrixTranspose::run(void) {
|
||||
|
||||
_perfInfo = (float)perf;
|
||||
testDescString = "";
|
||||
char str[64];
|
||||
sprintf(str, "(%d,%d) matrix with (%2d,%2d) block size %fms (GB/s) ", width_, height_, blockSize_,
|
||||
char str[90];
|
||||
snprintf(str, sizeof(str), "(%d,%d) matrix with (%2d,%2d) block size %fms (GB/s) ", width_, height_, blockSize_,
|
||||
blockSize_, (sec / (double)MAX_ITERATIONS) * 1000.);
|
||||
testDescString += str;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user