diff options
author | waker <wakeroid@gmail.com> | 2011-03-19 12:18:57 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-03-19 12:18:57 +0100 |
commit | 1a2de134de212772a28081bb37530554aac81c79 (patch) | |
tree | b5b64fe4a8136f554e9d9297fd4b05a173b3c16f /plugins.c | |
parent | 152958d9a61f1d39a28b8aa294322c193568f68b (diff) |
fix possible buffer overflow when getting XDG_LOCAL_HOME
Diffstat (limited to 'plugins.c')
-rw-r--r-- | plugins.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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"); |