summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYevhenii Dementieiev (GitHub) <ydementieiev@luxoft.com>2020-01-23 22:22:04 +0200
committerYevhenii Dementieiev (GitHub) <ydementieiev@luxoft.com>2020-01-23 22:22:04 +0200
commit8291f1fc155610bd60c00b80d84b10746558a9a4 (patch)
tree94ae46c6a890c933bb28868b1f9766df6958d781
parent0638eafbedee6ca6f9401e6f8aaa2514839507b2 (diff)
downloadsdl_core-feature/malformed_messages_verification.tar.gz
fixup! Add short condition for variable and fix build with Enable_log offfeature/malformed_messages_verification
-rw-r--r--src/components/protocol_handler/src/protocol_packet.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/protocol_handler/src/protocol_packet.cc b/src/components/protocol_handler/src/protocol_packet.cc
index 5d91394794..1f9fc431ae 100644
--- a/src/components/protocol_handler/src/protocol_packet.cc
+++ b/src/components/protocol_handler/src/protocol_packet.cc
@@ -349,11 +349,8 @@ RESULT_CODE ProtocolPacket::ProtocolHeaderValidator::validate(
case FRAME_TYPE_SINGLE:
case FRAME_TYPE_CONSECUTIVE:
case FRAME_TYPE_CONTROL: {
- bool wrongDataSize =
- (header.dataSize > payload_size) ||
- (FRAME_TYPE_CONTROL != header.frameType && header.dataSize == 0u);
-
- if (wrongDataSize) {
+ if (header.dataSize > payload_size ||
+ (FRAME_TYPE_CONTROL != header.frameType && header.dataSize == 0u)) {
UNUSED(StringifyFrameType);
LOG4CXX_WARN(
logger_,