Skip to content

Commit 63e667e

Browse files
committed
another caller responsibility for fetch_into_unchecked
1 parent 8835c5b commit 63e667e

File tree

1 file changed

+3
-1
lines changed
  • sdk/pinocchio/src/sysvars/slot_hashes

1 file changed

+3
-1
lines changed

sdk/pinocchio/src/sysvars/slot_hashes/raw.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ pub fn fetch_into(buffer: &mut [u8], offset: usize) -> Result<usize, ProgramErro
109109
/// The caller is responsible for ensuring that:
110110
/// 1. `buffer` is large enough for the requested `offset + buffer.len()` range and
111111
/// properly laid out (see `validate_buffer_size` and `validate_fetch_offset`).
112-
/// 2. The memory behind `buffer` is writable for its full length.
112+
/// 2. `offset + buffer.len()` is not greater than `MAX_SIZE`, or the syscall will
113+
/// fail.
114+
/// 3. The memory behind `buffer` is writable for its full length.
113115
///
114116
/// # Safety
115117
/// Internally this function performs an unchecked Solana syscall that writes

0 commit comments

Comments
 (0)