[SERVER-29325] Coverity analysis defect 101639: Uninitialized scalar variable Created: 23/May/17 Updated: 30/Oct/23 Resolved: 26/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.10 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Dianna Hohensee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | coverity | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Sharding 2017-07-10 |
| Participants: |
| Description |
|
Use of an uninitialized variable Defect 101639 (STATIC_C)
|
| Comments |
| Comment by Githook User [ 26/Jun/17 ] |
|
Author: {u'username': u'DiannaHohensee', u'name': u'Dianna Hohensee', u'email': u'dianna.hohensee@10gen.com'}Message: |
| Comment by Dianna Hohensee (Inactive) [ 23/Jun/17 ] |
|
The problem is that the boolean 'shardKeyIsUnique' field in the struct goes uninitialized. Adding two constructors, default with shardKeyIsUnique(false), and one that sets all the fields to specific values. |
| Comment by Eric Milkie [ 23/May/17 ] |
|
"CollectionAndChangedChunks" is a struct with no initializers for POD types in its constructor. |