Skip to content

Commit 85a806e

Browse files
committed
fix: attribute iteration extends past last defined attribute
1 parent 05ddf2b commit 85a806e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyth-sdk-solana/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-sdk-solana"
3-
version = "0.10.1"
3+
version = "0.10.2"
44
authors = ["Pyth Data Foundation"]
55
edition = "2018"
66
license = "Apache-2.0"

pyth-sdk-solana/src/state.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ pub struct ProductAccount {
191191

192192
impl ProductAccount {
193193
pub fn iter(&self) -> AttributeIter {
194-
AttributeIter { attrs: &self.attr }
194+
AttributeIter {
195+
attrs: &self.attr[..(self.size as usize - PROD_HDR_SIZE)],
196+
}
195197
}
196198
}
197199

0 commit comments

Comments
 (0)