diff options
author | Pablo Barciela <[email protected]> | 2019-03-17 02:13:08 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2019-03-17 16:13:44 +0100 |
commit | e1581c669f31e1a43155d2ac5fe0926568629eaf (patch) | |
tree | ff16f77fc34d4f1ef7793e79296012dcbd92e392 /libmate-desktop | |
parent | 08dc989b39451d49c0b2c01577c036d9f11d5141 (diff) | |
download | mate-desktop-e1581c669f31e1a43155d2ac5fe0926568629eaf.tar.bz2 mate-desktop-e1581c669f31e1a43155d2ac5fe0926568629eaf.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");
^~~~~~
Diffstat (limited to 'libmate-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); |