38 / d4-format

The D4 Quantitative Data Format
MIT License
150 stars 20 forks source link

misaligned pointer dereference in `read_next_value` #71

Open shinmao opened 1 year ago

shinmao commented 1 year ago

Hi, I found some potential unsoundness in safe method read_next_value: https://github.com/38/d4-format/blob/f8c008732679afa0524863a6d4890be0c96dc0f0/d4/src/ssio/view.rs#L177-L185 In line 184, the code will transmute type of &u8 to &u32 which will create a misaligned pointer, and the pointer is dereferenced in line 185 which will lead to undefined behavior. Is there any test function for read_next_value?