[PATCH 11/12] lib: fwts_log_html: use strncat instead of strcat

Colin King colin.king at canonical.com
Sun Nov 4 22:19:49 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_log_html.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/src/fwts_log_html.c b/src/lib/src/fwts_log_html.c
index c6d941a..009873f 100644
--- a/src/lib/src/fwts_log_html.c
+++ b/src/lib/src/fwts_log_html.c
@@ -222,7 +222,7 @@ static char *fwts_log_html_convert_ascii_str(const char *buffer)
 	/* Step 2, convert */
 	for (str1 = buffer; *str1; str1++) {
 		char *str = fwts_log_html_convert_ascii(*str1);
-		strcat(converted, str);
+		strncat(converted, str, len + 1);
 	}
 
 	return converted;
-- 
1.7.10.4




More information about the fwts-devel mailing list