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

Fix a bug in input deserialization in the C SDK #17217

Merged
merged 1 commit into from
May 14, 2021

Conversation

machacekch
Copy link
Contributor

Problem

When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: input += 7; // padding. Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.

Summary of Changes

Adjust the input pointer by 7 bytes whether the user cares about the account or not.

When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.
@mvines mvines requested a review from jackcmay May 13, 2021 23:26
@mvines mvines added the v1.6 label May 13, 2021
@machacekch
Copy link
Contributor Author

Looks like a general problem with the pipeline, unrelated to the change.

@jackcmay
Copy link
Contributor

What is the unrelated issue?

I'm working up a test case for this issue

@jackcmay
Copy link
Contributor

Ah, you are referring to CI, I kicked it

@mvines
Copy link
Member

mvines commented May 14, 2021

lgtm, @jackcmay any concerns landing so we can get this into 1.6.9 (cc: @CriesofCarrots)

@jackcmay
Copy link
Contributor

I'd like to see some tests to verify it but that could follow, I have limited service today so won't get to it asap

@CriesofCarrots CriesofCarrots merged commit e02b4e1 into solana-labs:master May 14, 2021
mergify bot pushed a commit that referenced this pull request May 14, 2021
When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.

(cherry picked from commit e02b4e1)
mergify bot added a commit that referenced this pull request May 15, 2021
When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.

Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.

(cherry picked from commit e02b4e1)

Co-authored-by: Christian Machacek <39452430+machacekch@users.noreply.github.com>
jackcmay added a commit to jackcmay/solana that referenced this pull request May 17, 2021
jackcmay added a commit that referenced this pull request May 17, 2021
mergify bot pushed a commit that referenced this pull request May 17, 2021
jackcmay added a commit that referenced this pull request May 19, 2021
mergify bot added a commit that referenced this pull request May 19, 2021
(cherry picked from commit f15dd1b)

Co-authored-by: Jack May <jack@solana.com>
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
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.

4 participants