forked from enlightenment/efl
ecore_x: Fix buffer overrun
Use strncpy to prevent buffer overrun on buf, and '\0' terminate. Fixes CID 1039584
This commit is contained in:
parent
8b72bd6e6d
commit
752d627a93
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue