summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShreyas B. Prabhu <shreyas@linux.vnet.ibm.com>2016-06-17 09:51:51 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-06-20 14:32:47 +1000
commit3aeb50189d4d88528c627e099c76b00e28e5c432 (patch)
tree6b32ff0bc2d6d82c52a7500ced0fd7649a779ae5
parentb6f940fbb83ab27fb5f9bb59f52b685709def93c (diff)
downloadtalos-skiboot-3aeb50189d4d88528c627e099c76b00e28e5c432.tar.gz
talos-skiboot-3aeb50189d4d88528c627e099c76b00e28e5c432.zip
slw: use strncpy instead of strcpy
Use strncpy instead of strcpy while appending to name_buf. Suggested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/slw.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/slw.c b/hw/slw.c
index 748e319a..f174ae4f 100644
--- a/hw/slw.c
+++ b/hw/slw.c
@@ -35,6 +35,7 @@
#include <sbe_xip_image.h>
#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);
OpenPOWER on IntegriCloud