Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

febo
Copy link
Contributor

@febo febo commented Jul 1, 2025

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
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Makes sense to me!

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