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: attribute iteration extends past last defined attribute #123

Merged
merged 16 commits into from
Aug 27, 2024
2 changes: 1 addition & 1 deletion pyth-sdk-solana/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyth-sdk-solana"
version = "0.10.1"
version = "0.10.2"
authors = ["Pyth Data Foundation"]
edition = "2018"
license = "Apache-2.0"
Expand Down
4 changes: 3 additions & 1 deletion pyth-sdk-solana/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ pub struct ProductAccount {

impl ProductAccount {
pub fn iter(&self) -> AttributeIter {
AttributeIter { attrs: &self.attr }
AttributeIter {
attrs: &self.attr[..(self.size as usize - PROD_HDR_SIZE)],
}
}
}

Expand Down
Loading