Coverity issues in vrouter utilities

Bug #1736160 reported by Andrei Bunghez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
Fix Committed
Medium
Andrei Bunghez
R4.0
New
Medium
Raghunandan Srinivasan
R4.1
Fix Committed
Medium
Andrei Bunghez
Trunk
Fix Committed
Undecided
Andrei Bunghez
OpenContrail
New
Undecided
Andrei Bunghez

Bug Description

Hi everybody,

Coverity reports several issues on vrouter utilities - OpenContrail 3.2:

- vif.c, in vr_intf_op - Using uninitialized value ret. (59738)
- udp_util.c, in udp_register_client - Variable cl going out of scope leaks the storage it points to. (59659)
- nl_util.c, in nl_dcb_parse_reply - Using uninitialized value attr when calling nl_parse_dcb_response. (59822)
- nl_util.c, in nl_register_client - Variable cl going out of scope leaks the storage it points to (59636)
- ini_parser.c, in parse_ini_file - Variable fp going out of scope leaks the storage it points to.(59656)
- flow.c, in flow_set_ip - Using uninitialized value token_length. (59737)
- flow.c, in flow_set_ip - Using uninitialized value ret. (59772)
- flow.c, in flow_set_match - Using uninitialized value token_length. (59769)

Cheers,
Andrei

Tags: vrouter
Changed in opencontrail:
assignee: nobody → Andrei Bunghez (abunghez)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

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

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

Reviewed: https://review.opencontrail.org/38102
Committed: http://github.com/Juniper/contrail-vrouter/commit/5fa48552c075a2323177e2d497849946fb06c4f7
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit 5fa48552c075a2323177e2d497849946fb06c4f7
Author: Andrei Bunghez <email address hidden>
Date: Mon Dec 4 16:55:30 2017 +0200

Several coverity issues in vrouter utilities

vif.c:
Initializing ret variable in vr_intf_op.

udp_util.c:
Using udp_free_client instead of udp_free, so that cl is freed as well.

nl_util.c:
Initializing attr in nl_dcb_parse_reply to DCB_ATTR_UNDEFINED.
Using nl_free_client to also free cl in nl_register_client. Otherwise, fields are freed but not the structure itself.

ini_parser.c:
Closing file before returning from parse_ini_file if ini_data allocation fails.

flow.c:
In flow_set_ip, updating match_string only if token is not null and token_length is assigned to and makes sense.
Initializing ret with 0 in flow_set_ip. It would be used uninitialized in the context of token being null.
In flow_set_match, updating match_string only if token is not null and token_length is assigned to and makes sense.

Change-Id: I04fbb636497f083099375c643d32a8997d0a4c0d
Closes-Bug: #1736160

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

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

Revision history for this message
Hari Prasad Killi (haripk) wrote :

please commit to master as well.

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

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

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

Reviewed: https://review.opencontrail.org/40578
Committed: http://github.com/Juniper/contrail-vrouter/commit/5cf5f17a38f12dde85ea7b0b9e49ba405ba9b794
Submitter: Zuul v3 CI (<email address hidden>)
Branch: master

commit 5cf5f17a38f12dde85ea7b0b9e49ba405ba9b794
Author: Andrei Bunghez <email address hidden>
Date: Mon Dec 4 16:55:30 2017 +0200

Several coverity issues in vrouter utilities

vif.c:
Initializing ret variable in vr_intf_op.

udp_util.c:
Using udp_free_client instead of udp_free, so that cl is freed as well.

nl_util.c:
Initializing attr in nl_dcb_parse_reply to DCB_ATTR_UNDEFINED.
Using nl_free_client to also free cl in nl_register_client. Otherwise, fields are freed but not the structure itself.

ini_parser.c:
Closing file before returning from parse_ini_file if ini_data allocation fails.

flow.c:
In flow_set_ip, updating match_string only if token is not null and token_length is assigned to and makes sense.
Initializing ret with 0 in flow_set_ip. It would be used uninitialized in the context of token being null.
In flow_set_match, updating match_string only if token is not null and token_length is assigned to and makes sense.

Change-Id: I04fbb636497f083099375c643d32a8997d0a4c0d
Closes-Bug: #1736160

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

Reviewed: https://review.opencontrail.org/40387
Committed: http://github.com/Juniper/contrail-vrouter/commit/36e8bf1fe14f558415d9a8b386aa9deb26fdd814
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit 36e8bf1fe14f558415d9a8b386aa9deb26fdd814
Author: Andrei Bunghez <email address hidden>
Date: Mon Dec 4 16:55:30 2017 +0200

Several coverity issues in vrouter utilities

vif.c:
Initializing ret variable in vr_intf_op.

udp_util.c:
Using udp_free_client instead of udp_free, so that cl is freed as well.

nl_util.c:
Initializing attr in nl_dcb_parse_reply to DCB_ATTR_UNDEFINED.
Using nl_free_client to also free cl in nl_register_client. Otherwise, fields are freed but not the structure itself.

ini_parser.c:
Closing file before returning from parse_ini_file if ini_data allocation fails.

flow.c:
In flow_set_ip, updating match_string only if token is not null and token_length is assigned to and makes sense.
Initializing ret with 0 in flow_set_ip. It would be used uninitialized in the context of token being null.
In flow_set_match, updating match_string only if token is not null and token_length is assigned to and makes sense.

Change-Id: I04fbb636497f083099375c643d32a8997d0a4c0d
Closes-Bug: #1736160
(cherry picked from commit 5fa48552c075a2323177e2d497849946fb06c4f7)

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.