From 3434358c76d3fd4165abaf5f75ede06d6781d98b Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Mon, 20 Jul 2020 10:19:55 +0900 Subject: [PATCH] Fix static analysis issue - TAINTED_INT.MIGHT Change-Id: I548cd0919572d5924ff22581ec793c5b6642e855 Signed-off-by: Jusung Son --- utils/src/logger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/src/logger.cc b/utils/src/logger.cc index c9c9a92..7bb1895 100644 --- a/utils/src/logger.cc +++ b/utils/src/logger.cc @@ -91,7 +91,7 @@ rpc_port_parcel_h Logger::Read() { int size = 0; int ret = Read(reinterpret_cast(&size), sizeof(size)); - if (ret < 0) + if (ret < 0 || size <= 0) return nullptr; auto* buf = new unsigned char[size]; -- 2.7.4