Coverity issues in contrail-controller/pkt_sandesh_flow.cc

Bug #1770441 reported by Anda Nicolae on 2018-05-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Medium
Anda Nicolae
Trunk
Fix Committed
Undecided
Anda Nicolae
OpenContrail
New
Undecided
Unassigned

Bug Description

Hi all,

I have run Coverity on branch R5.0 and it reported the following issues in contrail-controller/pkt_sandesh_flow.cc:

- uninit_use_in_call: Using uninitialized value vrf_id when calling InetRouteFlowMgmtKey in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
vrf_id_ is initialized if the following condition is fulfilled: if (getline(ss, item, ch))
However, the initialization of vrf_id may fail, and therefore we need to initialize it at declaration time.

- uninit_use_in_call: Using uninitialized value plen when calling InetRouteFlowMgmtKey in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
Similar logic as for vrf_id_. We need to initialize plen at declaration time.

- uninit_use: Using uninitialized value mgr_id in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
Similar logic as for vrf_id_ and plen. We need to initialize mgr_id at declaration time.

- uninit_use: Using uninitialized value proto in pkt_sandesh_flow.cc:SetFlowKey
Similar logic as for vrf_id_, plen and mgr_id. We need to initialize proto at declaration time.

Review in progress for https://review.opencontrail.org/42943
Submitter: Anda Nicolae (<email address hidden>)

Jeba Paulaiyan (jebap) on 2018-05-10
tags: added: vrouter

Review in progress for https://review.opencontrail.org/43022
Submitter: Anda Nicolae (<email address hidden>)

Reviewed: https://review.opencontrail.org/43022
Committed: http://github.com/Juniper/contrail-controller/commit/9f613441a492c0a334f2748be34577a587daf7c2
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 9f613441a492c0a334f2748be34577a587daf7c2
Author: Anda Nicolae <email address hidden>
Date: Thu May 10 19:32:12 2018 +0300

Coverity issues in contrail-controller/pkt_sandesh_flow.cc

I have run Coverity on branch R5.0 and it reported the
following issues in contrail-controller/pkt_sandesh_flow.cc:

- uninit_use_in_call: Using uninitialized value vrf_id when calling
InetRouteFlowMgmtKey in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
vrf_id_ is initialized if the following condition is fulfilled:
if (getline(ss, item, ch))
However, the initialization of vrf_id may fail, and therefore we need
to initialize it at declaration time.

- uninit_use_in_call: Using uninitialized value plen when calling
InetRouteFlowMgmtKey in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
Similar logic as for vrf_id_. We need to initialize plen atdeclaration
time.

- uninit_use: Using uninitialized value mgr_id
in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
Similar logic as for vrf_id_ and plen. We need to initialize
mgr_id at declaration time.

- uninit_use: Using uninitialized value proto
in pkt_sandesh_flow.cc:SetFlowKey
Similar logic as for vrf_id_, plen and mgr_id.
We need to initialize proto at declaration time.

Change-Id: I1ff631568616821e641cd37dcdd60128df1ab001
Closes-Bug: #1770441
Signed-off-by: Anda Nicolae <email address hidden>

OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/42943
Committed: http://github.com/Juniper/contrail-controller/commit/415096545165582cfa4ddd77f1122807a71f32a4
Submitter: Zuul v3 CI (<email address hidden>)
Branch: R5.0

commit 415096545165582cfa4ddd77f1122807a71f32a4
Author: Anda Nicolae <email address hidden>
Date: Thu May 10 19:32:12 2018 +0300

Coverity issues in contrail-controller/pkt_sandesh_flow.cc

I have run Coverity on branch R5.0 and it reported the
following issues in contrail-controller/pkt_sandesh_flow.cc:

- uninit_use_in_call: Using uninitialized value vrf_id when calling
InetRouteFlowMgmtKey in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
vrf_id_ is initialized if the following condition is fulfilled:
if (getline(ss, item, ch))
However, the initialization of vrf_id may fail, and therefore we need
to initialize it at declaration time.

- uninit_use_in_call: Using uninitialized value plen when calling
InetRouteFlowMgmtKey in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
Similar logic as for vrf_id_. We need to initialize plen atdeclaration
time.

- uninit_use: Using uninitialized value mgr_id
in pkt_sandesh_flow.cc:StringToInetRouteFlowMgmtKey
Similar logic as for vrf_id_ and plen. We need to initialize
mgr_id at declaration time.

- uninit_use: Using uninitialized value proto
in pkt_sandesh_flow.cc:SetFlowKey
Similar logic as for vrf_id_, plen and mgr_id.
We need to initialize proto at declaration time.

Change-Id: I1ff631568616821e641cd37dcdd60128df1ab001
Closes-Bug: #1770441
Signed-off-by: Anda Nicolae <email address hidden>

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers