Skip to main content

user_str

Function user_str 

Source
pub fn user_str<'a>(ptr: usize, len: usize, max_len: usize) -> Option<&'a str>
Expand description

ユーザ空間のバイト列を UTF-8 文字列として検証付きで借用する。 範囲外・非 UTF-8 の場合は Nonemax_len を超える長さは拒否する。 len == 0 はメモリを読まないため常に空文字列として許可する。