Skip to content

Fix: Add null check for new_owner_address in NFT transfer#152

Open
prjanitor wants to merge 1 commit into
crypto-libs:mainfrom
prjanitor:prjanitor/71c3653186da8e0c4d68c79a0034b13d76b2340b
Open

Fix: Add null check for new_owner_address in NFT transfer#152
prjanitor wants to merge 1 commit into
crypto-libs:mainfrom
prjanitor:prjanitor/71c3653186da8e0c4d68c79a0034b13d76b2340b

Conversation

@prjanitor

Copy link
Copy Markdown

Summary

This PR fixes a null pointer vulnerability in NFTItem.create_transfer_body() where the new_owner_address parameter could be None, causing write_address(None) to be called and potentially write invalid data or fail.

Changes

  • Added validation at the start of create_transfer_body() to check if new_owner_address is None
  • Raises ValueError with descriptive message if validation fails

Testing

The fix ensures that calling create_transfer_body() with new_owner_address=None will raise a clear error rather than silently writing invalid data to the cell.

Related

Fixes bug #257: Missing null check for response_address in NFT transfer


This PR was generated by PRJanitor — an automated tool that finds and fixes small bugs in open-source projects.

We respect your contribution guidelines — if your project doesn't accept bot PRs, we won't send more. You can also add a .github/prjanitor.yml file with enabled: false to opt out explicitly.

Validates that new_owner_address is not None before proceeding with
the transfer body creation. This prevents write_address from being
called with None when both response_address and new_owner_address
are None.
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.

1 participant