Patchwork [05/12] lib: fwts_klog: use strncpy instead of strcpy

login
register
mail settings
Submitter Colin King
Date Nov. 4, 2012, 10:19 p.m.
Message ID <1352067590-11820-6-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/197103/
State Rejected
Headers show

Comments

Colin King - Nov. 4, 2012, 10:19 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/lib/src/fwts_klog.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/src/lib/src/fwts_klog.c b/src/lib/src/fwts_klog.c
index c611247..7b01c42 100644
--- a/src/lib/src/fwts_klog.c
+++ b/src/lib/src/fwts_klog.c
@@ -194,7 +194,7 @@  static char *fwts_klog_unique_label(const char *str)
 	int count = 0;
 	bool forceupper = true;
 
-	strcpy(buffer, "Klog");
+	strncpy(buffer, "Klog", sizeof(buffer));
 	dst = buffer + 4;
 
 	while ((dst < (buffer + sizeof(buffer) - 1)) &&