diff options
author | Sebastian Dransfeld <sd@tango.flipp.net> | 2013-12-07 18:32:17 +0100 |
---|---|---|
committer | Sebastian Dransfeld <sd@tango.flipp.net> | 2013-12-07 21:11:34 +0100 |
commit | 752d627a93b56d8ffe640a30167a7cfb3d61bf91 (patch) | |
tree | 8abece97a229d986d91cf9596b5362e9a3851976 | |
parent | 8b72bd6e6d4aab3439eb4558c4a5776e17651f94 (diff) |
ecore_x: Fix buffer overrun
Use strncpy to prevent buffer overrun on buf, and '\0' terminate.
Fixes CID 1039584
-rw-r--r-- | src/lib/ecore_file/ecore_file_monitor_inotify.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ecore_file/ecore_file_monitor_inotify.c b/src/lib/ecore_file/ecore_file_monitor_inotify.c index bd78f92c5..e21e41c8c 100644 --- a/src/lib/ecore_file/ecore_file_monitor_inotify.c +++ b/src/lib/ecore_file/ecore_file_monitor_inotify.c @@ -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 |