[SERVER-50028] Coverity analysis defect 114771: Dereference after null check Created: 30/Jul/20 Updated: 29/Oct/23 Resolved: 11/Aug/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0, 4.4.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Benety Goh |
| 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 | ||||||||||||||||
| Backport Requested: |
v4.4
|
||||||||||||||||
| Sprint: | Execution Team 2020-08-24 | ||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
Dereference after null check Either the check against null is unnecessary, or there may be a null pointer dereference. Pointer is checked against null but then dereferenced anyway |
| Comments |
| Comment by Githook User [ 08/Sep/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: (cherry picked from commit bc2128c87dca30c758b87cc7bfcdfd6ab04e8e8d) |
| Comment by Githook User [ 11/Aug/20 ] |
|
Author: {'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}Message: |
| Comment by Benety Goh [ 07/Aug/20 ] |
|
It is also not possible for rs to be null because we dereference it a few lines below to get a cursor. |
| Comment by Benety Goh [ 07/Aug/20 ] |
|
It's not possible for coll to be nullptr because the caller retrieves the NamespaceString from the Collection. |