genext2fs icon indicating copy to clipboard operation
genext2fs copied to clipboard

Fix alignment issues for strict architectures

Open matoro opened this issue 2 years ago • 0 comments

Fixes two locations where unaligned accesses will cause bus errors on architectures that are strict about such accesses, namely sparc.

The first is in swab32_into, which is called with an offset of +1 into an unsigned char array from mklink_fs.

The second is in add2fs_from_tarball when checking the validity of a tarball, which casts a string from an unaligned position inside a struct to a long.

After these changes, the test suite passes on sparc.

matoro avatar May 17 '22 01:05 matoro