Skip to main content

get_return_data

Function get_return_data 

Source
pub fn get_return_data() -> Option<ReturnData>
Expand description

Retrieve return data from the most recent CPI call.

Returns None if no return data was set (length == 0).

The 1 KiB buffer is not zero-filled before the syscall, the syscall initializes exactly the reported prefix, and None is returned before any read when the length is 0. This is the bug class behind Quasar #238/#234 (an assume_init over a buffer the syscall never wrote, exposing uninitialized stack bytes as return data); Hopper’s shape is immune because uninitialized bytes can never escape: empty return data (including the off-chain path, where len stays 0) short-circuits to None, and every accessor reads only the syscall-initialized len-byte prefix.