summaryrefslogtreecommitdiff
path: root/plugins.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-19 12:18:57 +0100
committerGravatar waker <wakeroid@gmail.com>2011-03-19 12:18:57 +0100
commit1a2de134de212772a28081bb37530554aac81c79 (patch)
treeb5b64fe4a8136f554e9d9297fd4b05a173b3c16f /plugins.c
parent152958d9a61f1d39a28b8aa294322c193568f68b (diff)
fix possible buffer overflow when getting XDG_LOCAL_HOME
Diffstat (limited to 'plugins.c')
-rw-r--r--plugins.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins.c b/plugins.c
index 0f9056e1..2a8732db 100644
--- a/plugins.c
+++ b/plugins.c
@@ -726,7 +726,8 @@ plug_load_all (void) {
char xdg_plugin_dir[1024];
if (xdg_local_home) {
- strcpy (xdg_plugin_dir, xdg_local_home);
+ strncpy (xdg_plugin_dir, xdg_local_home, sizeof (xdg_plugin_dir));
+ xdg_plugin_dir[sizeof(xdg_plugin_dir)-1] = 0;
} else {
char *homedir = getenv ("HOME");