summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 18:32:17 +0100
committerSebastian Dransfeld <sd@tango.flipp.net>2013-12-07 21:11:34 +0100
commit752d627a93b56d8ffe640a30167a7cfb3d61bf91 (patch)
tree8abece97a229d986d91cf9596b5362e9a3851976
parent8b72bd6e6d4aab3439eb4558c4a5776e17651f94 (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.c5
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