Closed llooFlashooll closed 3 months ago
You only mention alignment issues, but the code here uses read_unaligned
which is explicitly allowed to read unaligned data. If you believe there is something else incorrect about this code, please say what you think the issue is, specifically.
When using static analysis tools that may have false positives, generally you need to look at the code being flagged to ensure that it is not a false positive, as in this case.
Ok, thank you very much for your report. That's my bad. I will try to only report TP.
Hi, I am scanning the bytemuck in the latest version with my own static analyzer tool.
Unsafe conversion found at: src/internal.rs:117:17: 117:45
This unsound implementation would create a misalignment issues. The
[u8]
andT
are different types.This would potentially cause undefined behaviors in Rust. If we further manipulate the problematic converted types, it would potentially lead to different consequences. I am reporting this issue for your attention.