[SERVER-30424] Coverity analysis defect 101903: Dereference before null check Created: 31/Jul/17 Updated: 30/Oct/23 Resolved: 14/Aug/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.12 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Kaloian Manassiev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | coverity | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||
| Description |
|
All paths that lead to this null pointer comparison already dereference the pointer earlier Defect 101903 (STATIC_C)
|
| Comments |
| Comment by Githook User [ 14/Aug/17 ] |
|
Author: {'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com', 'name': 'Kaloian Manassiev'}Message: |
| Comment by Githook User [ 14/Aug/17 ] |
|
Author: {'name': 'Kaloian Manassiev', 'username': 'kaloianm', 'email': 'kaloian.manassiev@mongodb.com'}Message: |
| Comment by Esha Maharishi (Inactive) [ 11/Aug/17 ] |
|
kaloian.manassiev, I think this might be due to your commit to put the chunk loader on the ServiceContext. A line that was added in that commit unconditionally dereferences the opCtx: https://github.com/mongodb/mongo/blame/r3.5.11/src/mongo/db/db.cpp#L1010 but later in that function, there is an if(opCtx) check: https://github.com/mongodb/mongo/blame/r3.5.11/src/mongo/db/db.cpp#L1076 |