diff options
author | Pablo Barciela <[email protected]> | 2019-03-17 02:24:41 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2019-03-17 16:13:55 +0100 |
commit | 8eedb8b7fa80c1e6cbf67c0d9543c8e5dcb6684f (patch) | |
tree | 1482d1d4a98feeb1e0ea7acafd6ec4138182b034 /libmate-desktop/mate-desktop-item.c | |
parent | e1581c669f31e1a43155d2ac5fe0926568629eaf (diff) | |
download | mate-desktop-8eedb8b7fa80c1e6cbf67c0d9543c8e5dcb6684f.tar.bz2 mate-desktop-8eedb8b7fa80c1e6cbf67c0d9543c8e5dcb6684f.tar.xz |
[Security] Use 'g_strlcpy' instead of 'strcpy'
Fixes Clang static analyzer warnings:
mate-rr-config.c:549:3: warning: Call to function 'strcpy' 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 'strlcpy'. CWE-119
strcpy (output->priv->vendor, "???");
^~~~~~
mate-desktop-item.c:2118:2: warning: Call to function 'strcpy' 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 'strlcpy'. CWE-119
strcpy (the_exec, exec);
^~~~~~
Diffstat (limited to 'libmate-desktop/mate-desktop-item.c')
-rw-r--r-- | libmate-desktop/mate-desktop-item.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmate-desktop/mate-desktop-item.c b/libmate-desktop/mate-desktop-item.c index 7b96385..f7b1154 100644 --- a/libmate-desktop/mate-desktop-item.c +++ b/libmate-desktop/mate-desktop-item.c @@ -2115,7 +2115,7 @@ mate_desktop_item_launch_on_screen_with_env ( /* make a new copy and get rid of spaces */ the_exec = g_alloca (strlen (exec) + 1); - strcpy (the_exec, exec); + g_strlcpy (the_exec, exec, strlen (exec) + 1); if ( ! strip_the_amp (the_exec)) { g_set_error (error, |