From 5aedbdf7d048681a4142bed4bfc171f39605f8fc Mon Sep 17 00:00:00 2001 From: ilho kim Date: Fri, 10 Nov 2023 13:13:54 +0900 Subject: [PATCH] Add handling of the invalid command type Change-Id: I97f4c1777fd6942cf6f3844e83e9ca76d469397a Signed-off-by: ilho kim --- src/server/request_handler/command_request_handler.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/request_handler/command_request_handler.cc b/src/server/request_handler/command_request_handler.cc index 3cb6b9d..fbe57d0 100644 --- a/src/server/request_handler/command_request_handler.cc +++ b/src/server/request_handler/command_request_handler.cc @@ -48,6 +48,12 @@ bool CommandRequestHandler::HandleRequest(unsigned char* data, size_t size, result_ = std::make_shared( ret, std::vector{}); return true; + } else { + LOG(ERROR) << "Invalid command type : " + << static_cast(parcel->GetCmd()); + result_ = std::make_shared( + PMINFO_R_ERROR, std::vector{}); + return false; } return true; -- 2.7.4