!221 告警修改回合5.0-Release

Merge pull request !221 from 李天刚/OpenHarmony-5.0-Release
This commit is contained in:
openharmony_ci
2024-08-23 08:30:25 +00:00
committed by Gitee
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023 Huawei Device Co., Ltd.
* Copyright (c) 2021-2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -48,6 +48,7 @@ namespace DistributedInput {
const uint32_t SCREEN_MSG_MAX = 40 * 1024 * 1024;
const uint32_t AUTH_SESSION_SIDE_SERVER = 0;
const uint32_t IPC_VECTOR_MAX_SIZE = 32;
const uint32_t EVENT_BUFFER_MAX = 512;
/*
* Device Type definitions
+2 -2
View File
@@ -1071,7 +1071,7 @@ int32_t InputHub::UnregisterFdFromEpoll(int fd) const
int32_t InputHub::ReadNotifyLocked()
{
size_t res;
char eventBuf[512];
char eventBuf[EVENT_BUFFER_MAX] = {0};
struct inotify_event *event;
DHLOGI("readNotify nfd: %{public}d\n", iNotifyFd_);
@@ -1087,7 +1087,7 @@ int32_t InputHub::ReadNotifyLocked()
{
size_t eventSize = 0;
size_t eventPos = 0;
while (res >= sizeof(*event)) {
while (res >= sizeof(*event) && eventPos < static_cast<size_t>(EVENT_BUFFER_MAX)) {
event = reinterpret_cast<struct inotify_event *>(eventBuf + eventPos);
JudgeDeviceOpenOrClose(*event);
eventSize = sizeof(*event) + event->len;