ecore_x: Fix buffer overrun

Use strncpy to prevent buffer overrun on buf, and '\0' terminate.

Fixes CID 1039584
This commit is contained in:
Sebastian Dransfeld 2013-12-07 18:32:17 +01:00
parent 8b72bd6e6d
commit 752d627a93
1 changed files with 4 additions and 1 deletions

View File

@ -199,7 +199,10 @@ _ecore_file_monitor_inotify_events(Ecore_File_Monitor *em, char *file, int mask)
if ((file) && (file[0]))
snprintf(buf, sizeof(buf), "%s/%s", em->path, file);
else
strcpy(buf, em->path);
{
strncpy(buf, em->path, sizeof(buf));
buf[PATH_MAX - 1] = 0;
}
isdir = mask & IN_ISDIR;
#if 0