Fix static analysis issue 57/238857/1
authorJusung Son <jusung07.son@samsung.com>
Mon, 20 Jul 2020 01:19:55 +0000 (10:19 +0900)
committerJusung Son <jusung07.son@samsung.com>
Mon, 20 Jul 2020 01:19:55 +0000 (10:19 +0900)
 - TAINTED_INT.MIGHT

Change-Id: I548cd0919572d5924ff22581ec793c5b6642e855
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
utils/src/logger.cc

index c9c9a92..7bb1895 100644 (file)
@@ -91,7 +91,7 @@ rpc_port_parcel_h Logger::Read()
 {
   int size = 0;
   int ret = Read(reinterpret_cast<void*>(&size), sizeof(size));
-  if (ret < 0)
+  if (ret < 0 || size <= 0)
     return nullptr;
 
   auto* buf = new unsigned char[size];