summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_menu.c
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-10-14 13:21:48 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-10-14 13:21:48 +0200
commit76721f415368b45d2d780e44faaf8b57a0b468e9 (patch)
tree3579608186e9d4a87815433c8d2194b8de79b9e7 /src/lib/efreet/efreet_menu.c
parente2dabc5d23c60a9faa79b4c5357da2a944c5272f (diff)
efreet: Check buffer size
CID 1039582, 1039583
Diffstat (limited to 'src/lib/efreet/efreet_menu.c')
-rw-r--r--src/lib/efreet/efreet_menu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/efreet/efreet_menu.c b/src/lib/efreet/efreet_menu.c
index 739e9c188a..b6103eba6e 100644
--- a/src/lib/efreet/efreet_menu.c
+++ b/src/lib/efreet/efreet_menu.c
@@ -3177,7 +3177,10 @@ efreet_menu_app_dir_scan(Efreet_Menu_Internal *internal, const char *path, const
3177 if (id) 3177 if (id)
3178 snprintf(buf2, sizeof(buf2), "%s-%s", id, fname); 3178 snprintf(buf2, sizeof(buf2), "%s-%s", id, fname);
3179 else 3179 else
3180 strcpy(buf2, fname); 3180 {
3181 strncpy(buf2, fname, PATH_MAX);
3182 buf2[PATH_MAX - 1] = '\0';
3183 }
3181 3184
3182 if (info->type == EINA_FILE_DIR) 3185 if (info->type == EINA_FILE_DIR)
3183 { 3186 {
@@ -3285,7 +3288,10 @@ efreet_menu_directory_dir_scan(const char *path, const char *relative_path,
3285 if (relative_path) 3288 if (relative_path)
3286 snprintf(buf2, sizeof(buf2), "%s/%s", relative_path, fname); 3289 snprintf(buf2, sizeof(buf2), "%s/%s", relative_path, fname);
3287 else 3290 else
3288 strcpy(buf2, fname); 3291 {
3292 strncpy(buf2, fname, PATH_MAX);
3293 buf2[PATH_MAX - 1] = '\0';
3294 }
3289 3295
3290 if (info->type == EINA_FILE_DIR) 3296 if (info->type == EINA_FILE_DIR)
3291 efreet_menu_directory_dir_scan(info->path, buf2, cache); 3297 efreet_menu_directory_dir_scan(info->path, buf2, cache);