From 0bcd4f73d29f9823c7b71541dd0a37ffa81af7a0 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Mon, 8 Aug 2016 18:32:16 +0900 Subject: [PATCH] elm filesel - handle api that might provide path too big for buffer this addresses a path that could be too small (unlikely due to max path generally being 4k), for a stack buffer. this should make coverity happy. fix CID 1356634 --- src/lib/elementary/elc_fileselector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c index f0469f1433..cb8e2eb84d 100644 --- a/src/lib/elementary/elc_fileselector.c +++ b/src/lib/elementary/elc_fileselector.c @@ -467,7 +467,8 @@ _filter_child(Elm_Fileselector_Data* sd, //Search entry filter if ((sd->search_string) && (sd->search_string[0] != '\0')) { - strcpy(temp_path, path); + strncpy(temp_path, path, sizeof(temp_path) - 1); + temp_path[sizeof(temp_path) - 1] = 0; pch = strchr(temp_path, '/'); while (pch != NULL) {