[core] Misc static analysis fixes [nil checks, truncation, casts]#9407
Merged
Conversation
Reorders nil checks to protect against unsafe dereference.
Code used to leak if registration failed for any reason.
zach2good
approved these changes
Feb 8, 2026
Frankie-hz
pushed a commit
to Frankie-hz/LSB
that referenced
this pull request
Feb 26, 2026
…ndSandBoat#9407) * Iterate over correct range for Campaign Ops missions * Return if failed to insert pet in zone * No blind cast of furnishing items into flower pots * Fix bazaar buy error logging when target is self * Proper bi-directional trade check * Check NPC is valid when talking as MON * Protect fclose for login.key * Erase entered player by ID in battlefields * Fix Tranquil Heart healing skill truncation * Add missing nil checks Reorders nil checks to protect against unsafe dereference. * Fix Aura Size mod truncation * Check correct variable for nil when adding member to party * Store battlefields as unique_ptr Code used to leak if registration failed for any reason. * Reorder nil check when loading elevators * static_cast GEO master * Ensure Skillchain effect was applied before dereferencing * Fix fishing unsafe dereference when the mob might not exist * Log if parent entity is nil while updating AI states
taylorleary
pushed a commit
to taylorleary/ZenithXI
that referenced
this pull request
Mar 26, 2026
…ndSandBoat#9407) * Iterate over correct range for Campaign Ops missions * Return if failed to insert pet in zone * No blind cast of furnishing items into flower pots * Fix bazaar buy error logging when target is self * Proper bi-directional trade check * Check NPC is valid when talking as MON * Protect fclose for login.key * Erase entered player by ID in battlefields * Fix Tranquil Heart healing skill truncation * Add missing nil checks Reorders nil checks to protect against unsafe dereference. * Fix Aura Size mod truncation * Check correct variable for nil when adding member to party * Store battlefields as unique_ptr Code used to leak if registration failed for any reason. * Reorder nil check when loading elevators * static_cast GEO master * Ensure Skillchain effect was applied before dereferencing * Fix fishing unsafe dereference when the mob might not exist * Log if parent entity is nil while updating AI states
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
Several more landmines surfaced by cppcheck/PVS
Steps to test these changes