From 5b8c750846229b444417e00b5d3c707cd7d9968c Mon Sep 17 00:00:00 2001 From: Sunwook Bae Date: Fri, 19 Apr 2013 09:45:09 +0900 Subject: [PATCH] Prevent fix Change-Id: I804d8312e121555ffaff5cbaad1a60896eec089f Signed-off-by: Sunwook Bae --- src/io/FIo_FileEventManagerImpl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/io/FIo_FileEventManagerImpl.cpp b/src/io/FIo_FileEventManagerImpl.cpp index 9ce1b20..28858ef 100644 --- a/src/io/FIo_FileEventManagerImpl.cpp +++ b/src/io/FIo_FileEventManagerImpl.cpp @@ -133,7 +133,7 @@ _FileEventManagerImpl::SendEvent(void) { unsigned long iter = 0; ssize_t length = 0; - char buffer[INOTIFY_BUFFER_LEN] = {0,}; + char buffer[INOTIFY_BUFFER_LEN + 1] = {0,}; unsigned long event = 0; String path; @@ -142,7 +142,7 @@ _FileEventManagerImpl::SendEvent(void) SysTryReturnResult(NID_IO, __inotifyFd != -1, E_IO, "Failed to inotify."); - length = read(__inotifyFd, buffer, INOTIFY_BUFFER_LEN -1); + length = read(__inotifyFd, buffer, INOTIFY_BUFFER_LEN); SysTryReturnResult(NID_IO, length < (long)INOTIFY_BUFFER_LEN, E_IO, "Read buffer has failed."); while (iter < static_cast (length)) -- 2.7.4