diff --git a/include/ntfs-3g/security.h b/include/ntfs-3g/security.h index f6a8dace..8612dc27 100644 --- a/include/ntfs-3g/security.h +++ b/include/ntfs-3g/security.h @@ -183,6 +183,7 @@ struct POSIX_SECURITY { int defcnt; int firstdef; u16 tagsset; + s32 alignment[0]; struct POSIX_ACL acl; } ; diff --git a/libntfs-3g/compress.c b/libntfs-3g/compress.c index fbd30ba9..e2575341 100644 --- a/libntfs-3g/compress.c +++ b/libntfs-3g/compress.c @@ -62,6 +62,10 @@ #include "logging.h" #include "misc.h" +#undef le16_to_cpup +/* the standard le16_to_cpup() crashes for unaligned data on some processors */ +#define le16_to_cpup(p) (*(u8*)(p) + (((u8*)(p))[1] << 8)) + /** * enum ntfs_compression_constants - constants used in the compression code */ diff --git a/libntfs-3g/object_id.c b/libntfs-3g/object_id.c index 555dd137..8799ddba 100644 --- a/libntfs-3g/object_id.c +++ b/libntfs-3g/object_id.c @@ -107,7 +107,11 @@ */ typedef struct { - GUID object_id; + union { + /* alignment may be needed to evaluate collations */ + u32 alignment; + GUID guid; + } object_id; } OBJECT_ID_INDEX_KEY; typedef struct {