Coverity reports access of uninitialized variable in viz_collector

Bug #1774968 reported by Andrei Bunghez on 2018-06-04
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R5.0
Fix Committed
Medium
Andrei Bunghez
Trunk
Fix Committed
Medium
Andrei Bunghez
OpenContrail
New
Undecided
Unassigned

Bug Description

contrail-analytics R5.0

Hi all,

Coverity reports access of uninitialized variable collector_ when calling the constructor for VizCollector.
The constructor of VizCollector (viz_collector.cc) creates db_initilizer_ by passing the result of member function DbGlobalName. This calls the DbGlobalName method of collector_ (member in VizCollector), which has not yet been initialized. (68205,68642)

Regards,
Andrei

tags: added: analytics

Review in progress for https://review.opencontrail.org/43491
Submitter: Andrei Bunghez (<email address hidden>)

Review in progress for https://review.opencontrail.org/43614
Submitter: Andrei Bunghez (<email address hidden>)

Reviewed: https://review.opencontrail.org/43614
Committed: http://github.com/Juniper/contrail-analytics/commit/947e357e93dbb006d8fe7af81eebca8f7bac09ce
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 947e357e93dbb006d8fe7af81eebca8f7bac09ce
Author: Andrei Bunghez <email address hidden>
Date: Mon Jun 4 10:28:57 2018 +0000

Fixing uninitialized field during VizCollector constructor call

collector_ is not initialized on VizCollector constructor call,
when method DbGlobalName is called. This method, in turn, calls
method collector_->DbGlobalName. Since this method does not make any
reference to object data (this being the reason it does not visbly
crash) the method could be made static.

Change-Id: Ifaa8d0c5affc33aee48a2328a427ef1eb6b6c74d
Closes-Bug: #1774968

OpenContrail Admin (ci-admin-f) wrote :

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

commit dc1e0f7bd606faf0c6488cfe1a9d9f04d508827d
Author: Andrei Bunghez <email address hidden>
Date: Mon Jun 4 10:28:57 2018 +0000

Fixing uninitialized field during VizCollector constructor call

collector_ is not initialized on VizCollector constructor call,
when method DbGlobalName is called. This method, in turn, calls
method collector_->DbGlobalName. Since this method does not make any
reference to object data (this being the reason it does not visbly
crash) the method could be made static.

Change-Id: Ifaa8d0c5affc33aee48a2328a427ef1eb6b6c74d
Closes-Bug: #1774968

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

Other bug subscribers