diff options
author | Pablo Barciela <[email protected]> | 2019-03-17 02:13:08 +0100 |
---|---|---|
committer | Pablo Barciela <[email protected]> | 2019-03-17 16:25:49 +0100 |
commit | 3233410b3a2c23ac6d05e9603787fce5b530e364 (patch) | |
tree | 8d4327e64ac1ea3374aa028e9b3fbe4b4f56031f | |
parent | 82f424e0e745304adc7af385407eaaafa494ee10 (diff) | |
download | mate-desktop-3233410b3a2c23ac6d05e9603787fce5b530e364.tar.bz2 mate-desktop-3233410b3a2c23ac6d05e9603787fce5b530e364.tar.xz |
[Security] test-ditem: Use 'g_strlcat' instead of 'strcat'
Fixes Clang static analyzer warning:
test-ditem.c:94:2: warning: Call to function 'strcat' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcat'. CWE-119
strcat (path, "/foo.desktop");
^~~~~~
-rw-r--r-- | libmate-desktop/test-ditem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmate-desktop/test-ditem.c b/libmate-desktop/test-ditem.c index d5cac2d..8ab6d29 100644 --- a/libmate-desktop/test-ditem.c +++ b/libmate-desktop/test-ditem.c @@ -91,7 +91,7 @@ test_ditem (const char *file) "Neu gesetzt!"); getcwd (path, 255 - strlen ("/foo.desktop")); - strcat (path, "/foo.desktop"); + g_strlcat (path, "/foo.desktop", sizeof (path)); g_print ("Saving to foo.desktop\n"); uri = g_filename_to_uri (path, NULL, NULL); |