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
This commit is contained in:
Carsten Haitzler 2016-08-08 18:32:16 +09:00
parent 933c0a6b04
commit 0bcd4f73d2
1 changed files with 2 additions and 1 deletions

View File

@ -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)
{