From f5ef98747f7e221f6f67584eca82b0bca2ab8e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E9=99=B6=E9=87=91=E6=B2=9B=E2=80=9D?= Date: Fri, 6 Jun 2025 10:42:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=94=E8=BE=83=E4=B8=A4=E4=B8=AA=E8=A1=A8?= =?UTF-8?q?=E8=BE=BE=E5=BC=8F=E6=97=B6=EF=BC=8C=E5=B7=A6=E4=BE=A7=E5=80=BE?= =?UTF-8?q?=E5=90=91=E4=BA=8E=E5=8F=98=E5=8C=96=EF=BC=8C=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E5=80=BE=E5=90=91=E4=BA=8E=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “陶金沛” --- interfaces/kits/js/src/mod_fs/class_watcher/watcher_entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/kits/js/src/mod_fs/class_watcher/watcher_entity.cpp b/interfaces/kits/js/src/mod_fs/class_watcher/watcher_entity.cpp index ee0c1b56d..54d9851bf 100644 --- a/interfaces/kits/js/src/mod_fs/class_watcher/watcher_entity.cpp +++ b/interfaces/kits/js/src/mod_fs/class_watcher/watcher_entity.cpp @@ -194,7 +194,7 @@ void FileWatcher::ReadNotifyEvent(WatcherCallback callback) while (((len = read(notifyFd_, &buf, sizeof(buf))) < 0) && (errno == EINTR)) {}; while (index < len) { event = reinterpret_cast(buf + index); - if (sizeof(struct inotify_event) > (len - index)) { + if ((len - index) < sizeof(struct inotify_event)) { HILOGE("out of bounds access, len:%{public}d, index: %{public}d, inotify: %{public}zu", len, index, sizeof(struct inotify_event)); break; -- Gitee