Skip to content

p-token: Add unsafe qualifier to validate owner - #66

Merged
febo merged 2 commits into
mainfrom
febo/unsafe-validate-owner
Jul 9, 2025
Merged

p-token: Add unsafe qualifier to validate owner#66
febo merged 2 commits into
mainfrom
febo/unsafe-validate-owner

Conversation

@febo

@febo febo commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Problem

The validate_owner helper function has specific safety requirements to avoid undefine behaviour: the owner_account_info cannot be mutably borrowed. At the same time, the function is not qualified as unsafe.

Solution

Add the unsafe qualifier to the function and update every callsite.

cc: @d0nutptr

@febo
febo requested a review from joncinque July 1, 2025 14:42

@joncinque joncinque left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

@febo
febo force-pushed the febo/unsafe-validate-owner branch from cdf6cc3 to f82f939 Compare July 9, 2025 09:54
@febo
febo marked this pull request as ready for review July 9, 2025 10:07
@febo
febo merged commit d05d108 into main Jul 9, 2025
15 checks passed
@febo
febo deleted the febo/unsafe-validate-owner branch August 22, 2025 14:54
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.

2 participants