OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
authorManeesh Gupta <maneesh.gupta@amd.com>
Tue, 28 Apr 2015 07:38:31 +0000 (13:08 +0530)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Jun 2015 21:25:21 +0000 (23:25 +0200)
commit5260ba3e16a23a2b8a0ff161cfb9a57cdf91992f
tree1a1374fa5e178374c4d85009b017529e6f71c882
parent427cf443ab1f905056399cbe19aa46107e275f98
OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c

The opt_opencl_bench function copied the device name using strcpy without checking if the source string was larger.
This patch fixes this by replacing the strcpy with av_strlcpy, with the string copy size capped to the destination buffer size.

Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf234552b83a9503ff96572de2658b921b8842eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
cmdutils_opencl.c