From cc89eb2af953aaadf2c5f2f252169497916e272a Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Mon, 14 Oct 2013 13:07:43 +0200 Subject: [PATCH] efreet: Check size of buffer and '\0' terminate CID 1039595 --- src/bin/efreet/efreet_desktop_cache_create.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/efreet/efreet_desktop_cache_create.c b/src/bin/efreet/efreet_desktop_cache_create.c index 4a25575..577091f 100644 --- a/src/bin/efreet/efreet_desktop_cache_create.c +++ b/src/bin/efreet/efreet_desktop_cache_create.c @@ -152,7 +152,10 @@ cache_scan(const char *path, const char *base_id, int priority, int recurse, int if (*base_id) snprintf(id, sizeof(id), "%s-%s", base_id, fname); else - strcpy(id, fname); + { + strncpy(id, fname, PATH_MAX); + id[PATH_MAX - 1] = '\0'; + } file_id = id; } -- 2.7.4