From 38c8a8edc26d8656eaaafbed56171b52a7a81503 Mon Sep 17 00:00:00 2001 From: Andrei Bunghez Date: Fri, 25 May 2018 11:55:12 +0000 Subject: [PATCH] Coverity issues in VmFlowRef constructor Coverity reports the following issues in the VmFlowRef(const VmFlowRef &rhs) constructor: Using uninitialized value this->fd_(59780) Non-static class member fd_ is not initialized in this constructor nor in any functions that it calls. Non-static class member port_ is not initialized in this constructor nor in any functions that it calls. Non-static class member flow_ is not initialized in this constructor nor in any functions that it calls. (59794). Change-Id: Iaf29a87a0adc4746559a1ca9ddf3ee4fc6e41136 Closes-Bug: #1773354 --- src/vnsw/agent/pkt/flow_entry.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/vnsw/agent/pkt/flow_entry.cc b/src/vnsw/agent/pkt/flow_entry.cc index d688e115024..b3e0632c4dc 100644 --- a/src/vnsw/agent/pkt/flow_entry.cc +++ b/src/vnsw/agent/pkt/flow_entry.cc @@ -111,6 +111,11 @@ VmFlowRef::VmFlowRef() : } VmFlowRef::VmFlowRef(const VmFlowRef &rhs) { + + fd_ = VmFlowRef::kInvalidFd; + port_ = 0; + flow_ = NULL; + // UPDATE on linklocal flows is not supported. So, fd_ should be invalid assert(fd_ == VmFlowRef::kInvalidFd); assert(rhs.fd_ == VmFlowRef::kInvalidFd);