From 026f4de0628c3e7e0211ee0f6c96e816ff757cd1 Mon Sep 17 00:00:00 2001
From: Maneesh Gupta <maneesh.gupta@amd.com>
Date: Sat, 25 Apr 2015 11:17:05 +0530
Subject: [PATCH 2/2] OpenCL: Replace strcpy with strncpy to avoid buffer
 overflows

Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com>
---
 cmdutils_opencl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cmdutils_opencl.c b/cmdutils_opencl.c
index 3dfd156..73cab98 100644
--- a/cmdutils_opencl.c
+++ b/cmdutils_opencl.c
@@ -238,7 +238,7 @@ int opt_opencl_bench(void *optctx, const char *opt, const char *arg)
                 devices[count].platform_idx = i;
                 devices[count].device_idx = j;
                 devices[count].runtime = score;
-                strcpy(devices[count].device_name, device_node->device_name);
+                strncpy(devices[count].device_name, device_node->device_name, 64);
                 count++;
             }
         }
-- 
1.9.5.msysgit.0

