summaryrefslogtreecommitdiff
path: root/libmate-desktop/test-ditem.c
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-17 02:13:08 +0100
committerZenWalker <[email protected]>2019-03-17 16:13:44 +0100
commite1581c669f31e1a43155d2ac5fe0926568629eaf (patch)
treeff16f77fc34d4f1ef7793e79296012dcbd92e392 /libmate-desktop/test-ditem.c
parent08dc989b39451d49c0b2c01577c036d9f11d5141 (diff)
downloadmate-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/test-ditem.c')
-rw-r--r--libmate-desktop/test-ditem.c2
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);