diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMatrixTranspose.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMatrixTranspose.cpp index ad79b2a1a3..d4520b5f9a 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMatrixTranspose.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfMatrixTranspose.cpp @@ -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; } diff --git a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfSHA256.cpp b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfSHA256.cpp index 28ec411837..0b98145713 100644 --- a/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfSHA256.cpp +++ b/projects/clr/opencl/tests/ocltst/module/perf/OCLPerfSHA256.cpp @@ -777,8 +777,8 @@ void OCLPerfSHA256::run(void) { } testDescString += "with "; - char str[40]; - sprintf(str, "%2d ip buff and %2d op buff ", num_input_buf_, num_output_buf_); + char str[45]; + snprintf(str, sizeof(str), "%2d ip buff and %2d op buff ", num_input_buf_, num_output_buf_); testDescString += str; } diff --git a/projects/clr/opencl/tests/ocltst/module/runtime/OCLThreadTrace.cpp b/projects/clr/opencl/tests/ocltst/module/runtime/OCLThreadTrace.cpp index 4476dc246d..517d98237d 100644 --- a/projects/clr/opencl/tests/ocltst/module/runtime/OCLThreadTrace.cpp +++ b/projects/clr/opencl/tests/ocltst/module/runtime/OCLThreadTrace.cpp @@ -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");