Skip to content

Commit cc089ba

Browse files
authored
Merge pull request #98 from darwinzer0/master
fix out of bounds bug
2 parents f422f9d + 44e72e7 commit cc089ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/storage/src/append_store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ impl<'a, T: Serialize + DeserializeOwned, Ser: Serde> AppendStore<'a, T, Ser> {
160160
/// gets the element at pos if within bounds
161161
pub fn get_at(&self, storage: &dyn Storage, pos: u32) -> StdResult<T> {
162162
let len = self.get_len(storage)?;
163-
if pos > len {
163+
if pos >= len {
164164
return Err(StdError::generic_err("append_store access out of bounds"));
165165
}
166166
self.get_at_unchecked(storage, pos)

0 commit comments

Comments
 (0)