From f4aff1d9d94046b945156405c27b7c5fe7245b8b Mon Sep 17 00:00:00 2001 From: aajwy-gitee <13051180828@163.com> Date: Fri, 8 Oct 2021 09:33:28 +0000 Subject: [PATCH] =?UTF-8?q?update=20services/hilogd/log=5Fcollector.cpp.?= =?UTF-8?q?=20=20=20=20=20insert=E5=B9=B6=E6=B2=A1=E5=8A=A0=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=99=90=E5=88=B6=EF=BC=8C=E9=80=A0=E6=88=90type?= =?UTF-8?q?=E8=B6=8A=E7=95=8C=EF=BC=8C=E6=9C=80=E8=BF=91=E6=A0=91=E8=8E=93?= =?UTF-8?q?=E6=B4=BE=E5=87=BA=E7=8E=B0=E4=BA=86hilog=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E6=9C=80=E5=90=8E=E5=8E=9F=E5=9B=A0?= =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E5=9C=A8msg->type=E8=B6=85=E5=87=BA=E4=BA=86?= =?UTF-8?q?LOG=5FTYPE=5FMAX=EF=BC=8C=E5=BC=95=E8=B5=B7=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: aajwy <13051180828@163.com> --- services/hilogd/log_collector.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/hilogd/log_collector.cpp b/services/hilogd/log_collector.cpp index 14e20d9..8ee8fd3 100644 --- a/services/hilogd/log_collector.cpp +++ b/services/hilogd/log_collector.cpp @@ -101,6 +101,9 @@ void LogCollector::operator()() size_t LogCollector::InsertLogToBuffer(const HilogMsg& msg) { + if (msg.type >= LOG_TYPE_MAX) { + return ERR_LOG_TYPE_INVALID; + } size_t result = hilogBuffer->Insert(msg); if (result <= 0) { return result; -- Gitee