Skip to main content

validate_tag_sequence

Function validate_tag_sequence 

Source
pub fn validate_tag_sequence(
    bytes: &[u8],
    is_end_tag: impl FnMut(&[u8]) -> bool,
) -> Result<bool, MemoryError>
Expand description

Validates a sequence of padded Multiboot2 (header) tags.

Both Multiboot2 information tags and Multiboot2 header tags use an 8-byte tag header with the reported tag size stored in bytes 4..8. The reported size excludes alignment padding, but each following tag starts at the next 8-byte boundary.

Returns Ok(true) when a valid end tag is present exactly at the end of the provided byte range, and Ok(false) when the byte range ends without an end tag.