mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Prevent GraphemeStrs created from Strings from leaking (#7920)
This commit is contained in:
parent
ee3171cc54
commit
01776e6851
@ -481,7 +481,7 @@ fn from(g: String) -> Self {
|
||||
let ptr = Box::into_raw(g.into_bytes().into_boxed_slice()) as *mut u8;
|
||||
GraphemeStr {
|
||||
ptr: unsafe { NonNull::new_unchecked(ptr) },
|
||||
len: i32::try_from(len).unwrap() as u32,
|
||||
len: (i32::try_from(len).unwrap() as u32) | Self::MASK_OWNED,
|
||||
phantom: PhantomData,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user