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

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

Patch

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;