-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unaligned Pointer Read #274
Comments
Hi, thanks for reporting this issue, and I'm glad you're using the project! You are absolutely right, the types do not match up for Do you have a minimal example which I can use to reproduce this issue, and make sure it doesn't happen again? |
Sorry nothing I can share at the moment. I detected it because I'm rewriting part of cfitsio in rust which in debug mode checks for misaligned pointer reads. |
Ok thanks. I've merged in a fix and am ok to not include a test for now. Can you use the latest |
@petesmc have you had a chance to test my fix? |
Looks good for bytes, but think you need to update the u16/i16 as well to TUSHORT/TSHORT |
@petesmc done, can you check again? |
This test using a i8 results in an unaligned pointer read...
rust-fitsio/fitsio/src/headers.rs
Line 246 in 1972db6
... due to
... in the below.
rust-fitsio/fitsio/src/headers.rs
Lines 102 to 125 in 1972db6
Which calls
ffpkyj
in the cfitsio library like so:I believe to fix this, you need to convert i8 -> i16 given you are using TSHORT, OR map i8 to TBYTE instead.
The text was updated successfully, but these errors were encountered: