summaryrefslogtreecommitdiff
path: root/src/lib
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 /src/lib
parent8b72bd6e6d4aab3439eb4558c4a5776e17651f94 (diff)
ecore_x: Fix buffer overrun
Use strncpy to prevent buffer overrun on buf, and '\0' terminate. Fixes CID 1039584
Diffstat (limited to 'src/lib')
-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 bd78f92c50..e21e41c8c4 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)
199 if ((file) && (file[0])) 199 if ((file) && (file[0]))
200 snprintf(buf, sizeof(buf), "%s/%s", em->path, file); 200 snprintf(buf, sizeof(buf), "%s/%s", em->path, file);
201 else 201 else
202 strcpy(buf, em->path); 202 {
203 strncpy(buf, em->path, sizeof(buf));
204 buf[PATH_MAX - 1] = 0;
205 }
203 isdir = mask & IN_ISDIR; 206 isdir = mask & IN_ISDIR;
204 207
205#if 0 208#if 0