pub unsafe extern "C" fn aws_byte_cursor_advance_nospec(
    cursor: *mut aws_byte_cursor,
    len: usize
) -> aws_byte_cursor
Expand description

Behaves identically to aws_byte_cursor_advance, but avoids speculative execution potentially reading out-of-bounds pointers (by returning an empty ptr in such speculated paths).

This should generally be done when using an untrusted or data-dependent value for ‘len’, to avoid speculating into a path where cursor->ptr points outside the true ptr length.