fix(w3dmodeldraw): Prevent null dereference in W3DModelDraw::handleClientRecoil() - #3301
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. Walkthrough
ChangesRecoil handling safety
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The recoil path safely skips processing without a model state, with no remaining merge-blocking risk identified. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
| Filename | Overview |
|---|---|
| Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DModelDraw.cpp | Adds a correctly short-circuited null guard before accessing the current model state's barrel metadata. |
Reviews (1): Last reviewed commit: "fix(W3DDevice): Return from handleClient..." | Re-trigger Greptile
bobtista
left a comment
There was a problem hiding this comment.
LGTM good find. Maybe add labels to the PR, and did clang-tidy find a bunch more like this? If so, could make another PR with many of the same kind of change
|
Clang-Tidy found a bunch, but I feel that a lot of them are not 100% accurate so i'm slowly running through a list to see if anything pops out at me before bulk applying fixes that may not be needed. |
| @@ -2496,7 +2496,7 @@ void W3DModelDraw::handleClientTurretPositioning() | |||
| void W3DModelDraw::handleClientRecoil() | |||
| { | |||
| const W3DModelDrawModuleData* d = getW3DModelDrawModuleData(); | |||
There was a problem hiding this comment.
While at it, also move this past the return.
Fixes a null-pointer dereference when drawing a model without a current model state.
handleClientRecoil()previously readm_curState->m_validStuffeven whenm_curStatewas null.Found by clang-tidy