[Beignet] [PATCH] Runtime: fix a string overflow.
Yang Rong
rong.r.yang at intel.com
Mon Jul 18 04:45:19 UTC 2016
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
src/cl_program.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cl_program.c b/src/cl_program.c
index 644856c..17f64ca 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -965,7 +965,7 @@ cl_program_get_kernel_names(cl_program p, size_t size, char *names, size_t *size
len = strlen(ker_name);
if(names) {
strncpy(names, cl_kernel_get_name(p->ker[0]), size - 1);
- names[size] = '\0';
+ names[size - 1] = '\0';
if(size < len - 1) {
if(size_ret) *size_ret = size;
return;
--
2.1.4
More information about the Beignet
mailing list