Skip to content

[core] Misc static analysis fixes [nil checks, truncation, casts]#9407

Merged
Xaver-DaRed merged 18 commits into
LandSandBoat:basefrom
sruon:sast_fix
Feb 8, 2026
Merged

[core] Misc static analysis fixes [nil checks, truncation, casts]#9407
Xaver-DaRed merged 18 commits into
LandSandBoat:basefrom
sruon:sast_fix

Conversation

@sruon
Copy link
Copy Markdown
Contributor

@sruon sruon commented Feb 8, 2026

I affirm:

  • I understand that if I do not agree to the following points by completing the checkboxes my PR will be ignored.
  • I understand I should leave resolving conversations to the LandSandBoat team so that reviewers won't miss what was said.
  • I have read and understood the Contributing Guide and the Code of Conduct.
  • I have tested my code and the things my code has changed since the last commit in the PR and will test after any later commits.

What does this pull request do?

Several more landmines surfaced by cppcheck/PVS

  • Fix potentially bad furniture being cast as a Flowerpoint inconditionally
  • Return immediately when inserting a nullptr pet into the zone
  • Fixes the wrong variable being checked for nullptr when adding a member to a party
  • Fix wrong checks when checking if a trade is valid
  • Fix wrong iteration when sending Campaign Ops missions to the client
  • Smart pointers in battlefield handlers, resolves a memory leak in certain conditions.
  • Fix truncation for Tranquil Heart and AURA_SIZE mod
  • Reorders or adds missing nullptr checks in a lot of places

Steps to test these changes

@Xaver-DaRed Xaver-DaRed merged commit 7360d4b into LandSandBoat:base Feb 8, 2026
10 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants