py-spy icon indicating copy to clipboard operation
py-spy copied to clipboard

Potential misaligned pointer passed to `slice`

Open shinmao opened this issue 1 year ago • 0 comments

The source of unsoundness

Hi, I am wondering why the warning of alignment was suppressed here: https://github.com/benfred/py-spy/blob/492b41c07c26c6edbe061da942c8dae41d86091e/src/python_data_access.rs#L27-L31 bytes comes from the copy method of remoteprocess::ProcessMemory, which would copy and return a series of u8 from another address. Isn't it unsound to to cast to char which is aligned to 4 bytes? Please check and would love to have some discussion:)

shinmao avatar Sep 27 '23 21:09 shinmao