mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #22149 from seanm:sprintf
Replaced sprintf with safer snprintf * Straightforward replacement of sprintf with safer snprintf * Trickier replacement of sprintf with safer snprintf Some functions were changed to take another parameter: the size of the buffer, so that they can pass that size on to snprintf.
This commit is contained in:
@@ -354,7 +354,7 @@ static bool ocl_GaussianBlur_8UC1(InputArray _src, OutputArray _dst, Size ksize,
|
||||
|
||||
const char * const borderMap[] = { "BORDER_CONSTANT", "BORDER_REPLICATE", "BORDER_REFLECT", 0, "BORDER_REFLECT_101" };
|
||||
char build_opts[1024];
|
||||
sprintf(build_opts, "-D %s %s%s", borderMap[borderType & ~BORDER_ISOLATED],
|
||||
snprintf(build_opts, sizeof(build_opts), "-D %s %s%s", borderMap[borderType & ~BORDER_ISOLATED],
|
||||
ocl::kernelToStr(kernelX, CV_32F, "KERNEL_MATRIX_X").c_str(),
|
||||
ocl::kernelToStr(kernelY, CV_32F, "KERNEL_MATRIX_Y").c_str());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user