Coverity issue in contrail-controller/acl.cc

Bug #1777452 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
High
Anda-Maria Nicolae
Trunk
Fix Committed
High
Anda-Maria Nicolae
OpenContrail
New
Undecided
Unassigned

Bug Description

I have run Coverity on branch R5.0 and it reported the following issue in contrail-controller/acl.cc:FirewallPolicyIFNodeToReq()

uninit_use_in_call: Using uninitialized value ace_spec.type when calling Reverse

I've noticed that type field is indeed set in Reverse() function, but its value is never checked (for instance, in an if clause).

A solution I have found is to add another field, named NOT_USED, in enum AclTypeSpec and initialize in constructor method, type field with NOT_USED.

Thanks,
Anda

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

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

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

Review in progress for https://review.opencontrail.org/44089
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/44089
Committed: http://github.com/Juniper/contrail-controller/commit/16a43cec6f9ba9362c8a255ee8fff0ed286da07b
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 16a43cec6f9ba9362c8a255ee8fff0ed286da07b
Author: Anda Nicolae <email address hidden>
Date: Mon Jun 18 17:07:35 2018 +0300

Coverity issue in contrail-controller/acl.cc

I have run Coverity on branch R5.0 and it reported
the following issue in
contrail-controller/acl.cc:FirewallPolicyIFNodeToReq()

uninit_use_in_call: Using uninitialized value ace_spec.type
when calling Reverse

I've noticed that type field is indeed set in Reverse() function,
but its value is never checked (for instance, in an if clause).

A solution I have found is to add another field, named NOT_USED,
in enum AclTypeSpec and initialize "type" field with NOT_USED
in constructor.

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

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

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

commit ecb1e78a674ca8dfcd8472a708d5a3217d36a82b
Author: Anda Nicolae <email address hidden>
Date: Mon Jun 18 17:07:35 2018 +0300

Coverity issue in contrail-controller/acl.cc

I have run Coverity on branch R5.0 and it reported
the following issue in
contrail-controller/acl.cc:FirewallPolicyIFNodeToReq()

uninit_use_in_call: Using uninitialized value ace_spec.type
when calling Reverse

I've noticed that type field is indeed set in Reverse() function,
but its value is never checked (for instance, in an if clause).

A solution I have found is to add another field, named NOT_USED,
in enum AclTypeSpec and initialize "type" field with NOT_USED
in constructor.

Change-Id: I6cbc8063d7ac01644a97edd30cf021d41c8fe303
Closes-Bug: #1777452
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.