Skip to content

Commit

Permalink
[Security] eel-string: Use 'g_strlcat' instead of 'strcat'
Browse files Browse the repository at this point in the history
to avoid warnings with Clang Analyzer
  • Loading branch information
sc0w committed Mar 5, 2019
1 parent fede367 commit 7a26045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions eel/eel-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7a26045

Please sign in to comment.