[PATCH 10/12] lib: fwts_tagc: use strncat instead of strcat

Colin King colin.king at canonical.com
Sun Nov 4 22:19:48 UTC 2012


From: Colin Ian King <colin.king at canonical.com>

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_tag.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/src/fwts_tag.c b/src/lib/src/fwts_tag.c
index daf9b46..f0b0c9f 100644
--- a/src/lib/src/fwts_tag.c
+++ b/src/lib/src/fwts_tag.c
@@ -159,8 +159,8 @@ char *fwts_tag_list_to_str(fwts_list *taglist)
 		if (str) {
 			if ((str = realloc(str, len)) == NULL)
 				return NULL;
-			strcat(str, " ");
-			strcat(str, tag);
+			strncat(str, " ", len);
+			strncat(str, tag, len);
 		} else {
 			if ((str = malloc(len)) == NULL)
 				return NULL;
-- 
1.7.10.4




More information about the fwts-devel mailing list