From 7a26045d9b7ea816a3302253e0192013d44e8f45 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Sat, 23 Feb 2019 15:47:55 +0100 Subject: [Security] eel-string: Use 'g_strlcat' instead of 'strcat' to avoid warnings with Clang Analyzer --- eel/eel-string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eel/eel-string.c b/eel/eel-string.c index 7d95acdf..5ecef942 100644 --- a/eel/eel-string.c +++ b/eel/eel-string.c @@ -246,8 +246,8 @@ eel_str_middle_truncate (const char *string, truncated = g_new (char, strlen (string) + 1); g_utf8_strncpy (truncated, string, num_left_chars); - strcat (truncated, delimter); - strcat (truncated, g_utf8_offset_to_pointer (string, length - num_right_chars)); + g_strlcat (truncated, delimter, (truncate_length + 1)); + g_strlcat (truncated, g_utf8_offset_to_pointer (string, length - num_right_chars), (truncate_length + 1)); return truncated; } -- cgit v1.2.1