[SERVER-68789] Coverity analysis defect 123004: Dereference before null check Created: 12/Aug/22 Updated: 27/Oct/23 Resolved: 06/Sep/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Coverity Collector User | Assignee: | Ivan Fefer |
| Resolution: | Gone away | Votes: | 0 |
| Labels: | coverity, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Sprint: | QE 2022-09-19 |
| Participants: |
| Description |
|
Dereference before null check There may be a null pointer dereference, or else the comparison against null is unnecessary. All paths that lead to this null pointer comparison already dereference the pointer earlier |
| Comments |
| Comment by Ivan Fefer [ 06/Sep/22 ] |
|
I checked the code: pipeline null check was removed in this commit: So now everything is consistent with assuming pipeline is not null. I checked some callers of this function: they all also assume pipeline is not null, so adding an assertion here seems random and useless. |
| Comment by Kyle Suarez [ 12/Aug/22 ] |
|
Either pipeline should be checked for being null before the deference to get at the ExpressionContext, or the check for non-null pipeline on line 1066 should be elided since it's useless. |