summaryrefslogtreecommitdiff
path: root/eel
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-02-23 15:47:55 +0100
committerPablo Barciela <[email protected]>2019-03-05 01:19:03 +0100
commit7a26045d9b7ea816a3302253e0192013d44e8f45 (patch)
tree83354fd9911074ae9aaf45a3ef6482df8d73206f /eel
parentfede3677725c71920288dfa9a6acdd0230e6c68b (diff)
downloadcaja-7a26045d9b7ea816a3302253e0192013d44e8f45.tar.bz2
caja-7a26045d9b7ea816a3302253e0192013d44e8f45.tar.xz
[Security] eel-string: Use 'g_strlcat' instead of 'strcat'
to avoid warnings with Clang Analyzer
Diffstat (limited to 'eel')
-rw-r--r--eel/eel-string.c4
1 files 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;
}