Skip to content
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

Redo SPL send implementation following spec update #109

Open
wants to merge 1 commit into
base: fbe/sol_token_swap
Choose a base branch
from

Conversation

fbeutin-ledger
Copy link

No description provided.

@fbeutin-ledger fbeutin-ledger force-pushed the fbe/revamp_spl_send branch 6 times, most recently from 8378f4d to 9b36f57 Compare January 21, 2025 15:46
@fbeutin-ledger
Copy link
Author

C tests are broken because there is no mock feature
To fix later, too big to implement
Also this architecture split between libsol and src should be thought over

@fbeutin-ledger fbeutin-ledger force-pushed the fbe/revamp_spl_send branch 5 times, most recently from bf9a872 to 26bbe8b Compare January 21, 2025 16:13
trusted_name_info->struct_version = value;
return true;
static void trusted_info_reset(trusted_info_t *trusted_info) {
explicit_bzero(trusted_info, sizeof(trusted_info));
}

Choose a reason for hiding this comment

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

Should be sizeof(*trusted_info)

sig_ctx->input_sig_size));
// Save the encoded address
memset(out_encoded_address, 0, BASE58_PUBKEY_LENGTH);
memcpy(out_encoded_address, in_encoded_address.ptr, in_encoded_address.size);

Choose a reason for hiding this comment

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

Behavior is undefined if memcpy src or dst is NULL even when size is 0. In practice not sure it can happens because messages are signed and thus cannot be manipulated by an attacker.
Still better not to call memcpy with a null pointer y adding a precondition or setting it to a pointer even if size is 0 during parsing.

Copy link

@bboilot-ledger bboilot-ledger left a comment

Choose a reason for hiding this comment

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

C tests are broken because there is no mock feature
To fix later, too big to implement
Also this architecture split between libsol and src should be thought over

Yeah, I think the fuzzer might be broken too

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