-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Lines 71 to 75 in fd12a0a
| match reader.read(unsafe { | |
| from_raw_parts_mut(transmute::<*mut T, *mut u8>(obj as *mut T), len) | |
| }) { | |
| Some(x) => x == len, | |
| None => false, |
Hi, I consider that
load_prefix and save_prefix could have unsound implementation. At line 72, users could transmute arbitrary types to byte slice. However, if the types contains padding bytes, consider it as u8 could lead to undefined behavior. Based on the safety part in doc, callers are required to make sure the data points to initialized values while the function here didn't guarantee the safety.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels