From 3aeb50189d4d88528c627e099c76b00e28e5c432 Mon Sep 17 00:00:00 2001 From: "Shreyas B. Prabhu" Date: Fri, 17 Jun 2016 09:51:51 +0530 Subject: slw: use strncpy instead of strcpy Use strncpy instead of strcpy while appending to name_buf. Suggested-by: Michael Neuling Signed-off-by: Shreyas B. Prabhu Signed-off-by: Stewart Smith --- hw/slw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/slw.c b/hw/slw.c index 748e319..f174ae4 100644 --- a/hw/slw.c +++ b/hw/slw.c @@ -35,6 +35,7 @@ #include #define MAX_RESET_PATCH_SIZE 64 + static uint32_t slw_saved_reset[MAX_RESET_PATCH_SIZE]; static bool slw_current_le = false; @@ -689,7 +690,7 @@ void add_cpu_idle_state_properties(void) * If a state is supported add each of its property * to its corresponding property buffer. */ - strcpy(name_buf, states[i].name); + strncpy(name_buf, states[i].name, MAX_NAME_LEN); name_buf = name_buf + strlen(states[i].name) + 1; *latency_ns_buf = cpu_to_fdt32(states[i].latency_ns); -- cgit v1.1