Coverity issues in contrail-controller/oper

Bug #1770621 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
In Progress
Undecided
Anda-Maria Nicolae
Trunk
In Progress
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/oper:

- leaked_storage: Variable multicast_peer_path going out of scope leaks the storage it points to in agent_route.cc:ReComputeMulticastPaths
Indeed, multicast_peer_path should be freed if the following condition is matched:
if (!nh) {

- buffer_size_warning: Calling strncpy with a maximum size argument of 16 bytes on destination array ifrn.ifrn_name of size 16 bytes might leave the destination string unterminated in interface_params.cc:ObtainOsSpecificParams
Indeed, if name.c_str() is longer than IF_NAMESIZE bytes, then ifrn.ifrn_name will not end in '\0'.
Solution is to use:
strncpy(ifr.ifr_name, name.c_str(), IF_NAMESIZE-1);
since ifrn.ifrn_name was previously zeroed via memset.

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

Review in progress for https://review.opencontrail.org/42982
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/42983
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] R5.0

Review in progress for https://review.opencontrail.org/42982
Submitter: Nikhil Bansal (<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.