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:
Jimbo
2025-11-07 15:42:56 -05:00
committed by GitHub
parent de3b7322f2
commit 2006a411e5
3 changed files with 6 additions and 6 deletions
@@ -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;
}