Coverity issues in contrail-controller/mvpn_table.cc

Bug #1770394 reported by Anda-Maria Nicolae
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Undecided
Anda-Maria Nicolae
Trunk
Fix Committed
Undecided
Anda-Maria 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/mvpn_table.cc:

- uninit_use_in_call: Using uninitialized value prefix.ip_prefixlen_ when calling MvpnPrefix
- uninit_use_in_call: Using uninitialized value prefix.asn_ when calling MvpnPrefix

The issues listed above are encountered in the following functions from mvpn_table.cc:
MvpnTable::CreateType4LeafADRoutePrefix
MvpnTable::CreateType2ADRoutePrefix
MvpnTable::CreateType1ADRoutePrefix
MvpnTable::CreateType7PrefixFromType4
MvpnTable::CreateType3SPMSIRoutePrefix
MvpnTable::CreateType7SourceTreeJoinRoutePrefix

Indeed, the called MvpnPrefix constructor does not initialize neither ip_prefixlen_, nor asn_.
Solution is to initialize these variables when declaring them.

Tags: vrouter
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

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

Jeba Paulaiyan (jebap)
tags: added: vrouter
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

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

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R5.0

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

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

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

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

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

commit 9ad66279ef6c7eeb3fee451e1f9cf7920c998f26
Author: Anda Nicolae <email address hidden>
Date: Thu May 10 15:26:12 2018 +0300

Coverity issues in contrail-controller/mvpn_table.cc

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

- uninit_use_in_call: Using uninitialized value
prefix.ip_prefixlen_ when calling MvpnPrefix
- uninit_use_in_call: Using uninitialized value
prefix.asn_ when calling MvpnPrefix

The issues listed above are encountered in the following
functions from mvpn_table.cc:
MvpnTable::CreateType4LeafADRoutePrefix
MvpnTable::CreateType2ADRoutePrefix
MvpnTable::CreateType1ADRoutePrefix
MvpnTable::CreateType7PrefixFromType4
MvpnTable::CreateType3SPMSIRoutePrefix
MvpnTable::CreateType7SourceTreeJoinRoutePrefix

Indeed, the called MvpnPrefix constructor does not
initialize neither ip_prefixlen_, nor asn_.
Solution is to initialize these variables in all MvpnPrefix
constructors that did not initialize them.

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

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

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

commit a232cecc4cfa63746ab0e693f3cc3f61dcd4a5d1
Author: Anda Nicolae <email address hidden>
Date: Thu May 10 15:26:12 2018 +0300

Coverity issues in contrail-controller/mvpn_table.cc

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

- uninit_use_in_call: Using uninitialized value
prefix.ip_prefixlen_ when calling MvpnPrefix
- uninit_use_in_call: Using uninitialized value
prefix.asn_ when calling MvpnPrefix

The issues listed above are encountered in the following
functions from mvpn_table.cc:
MvpnTable::CreateType4LeafADRoutePrefix
MvpnTable::CreateType2ADRoutePrefix
MvpnTable::CreateType1ADRoutePrefix
MvpnTable::CreateType7PrefixFromType4
MvpnTable::CreateType3SPMSIRoutePrefix
MvpnTable::CreateType7SourceTreeJoinRoutePrefix

Indeed, the called MvpnPrefix constructor does not
initialize neither ip_prefixlen_, nor asn_.
Solution is to initialize these variables in all MvpnPrefix
constructors that did not initialize them.

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

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.