修改告警

Signed-off-by: li-tiangang4 <litiangang4@huawei.com>
This commit is contained in:
li-tiangang4
2024-12-16 15:29:23 +08:00
parent 6ca0b3fe2a
commit c5e9fa1e50
2 changed files with 3 additions and 3 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022-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
@@ -35,7 +35,7 @@ namespace DistributedInput {
};
const int32_t ENCRYPT_TAG_LEN = 32;
const int32_t MSG_MAX_SIZE = 45 * 1024;
const uint32_t MSG_MAX_SIZE = 45 * 1024;
const uint32_t SESSION_NAME_SIZE_MAX = 256;
const uint32_t DEVICE_ID_SIZE_MAX = 65;
@@ -466,7 +466,7 @@ bool DistributedInputTransportBase::CheckRecivedData(const std::string &message)
void DistributedInputTransportBase::OnBytesReceived(int32_t sessionId, const void *data, uint32_t dataLen)
{
if (sessionId < 0 || data == nullptr || dataLen <= 0) {
if (sessionId < 0 || data == nullptr || dataLen == 0 || dataLen > MSG_MAX_SIZE) {
DHLOGE("OnBytesReceived param check failed");
return;
}