Patchwork [01/12] lib: fwts_tag: use strncpy instead of strcpy

login
register
mail settings
Submitter Colin King
Date Nov. 4, 2012, 10:19 p.m.
Message ID <1352067590-11820-2-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/197099/
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_tag.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
index d8e9dad..daf9b46 100644
--- a/src/lib/src/fwts_tag.c
+++ b/src/lib/src/fwts_tag.c
@@ -164,7 +164,7 @@  char *fwts_tag_list_to_str(fwts_list *taglist)
 		} else {
 			if ((str = malloc(len)) == NULL)
 				return NULL;
-			strcpy(str, tag);
+			strncpy(str, tag, len);
 		}
 	}
 	return str;