diff --git a/libntfs-3g/logfile.c b/libntfs-3g/logfile.c index c8d53672..af47d7c8 100644 --- a/libntfs-3g/logfile.c +++ b/libntfs-3g/logfile.c @@ -90,10 +90,10 @@ static BOOL ntfs_check_restart_page_header(RESTART_PAGE_HEADER *rp, s64 pos) * Windows 8, and we will refuse to mount. * Nevertheless, do all the relevant checks before rejecting. */ - if (((rp->major_ver != const_cpu_to_le16(1)) - || (rp->minor_ver != const_cpu_to_le16(1))) - && ((rp->major_ver != const_cpu_to_le16(2)) - || (rp->minor_ver != const_cpu_to_le16(0)))) { + if ((!sle16_eq(rp->major_ver, const_cpu_to_le16(1)) + || !sle16_eq(rp->minor_ver, const_cpu_to_le16(1))) + && (!sle16_eq(rp->major_ver, const_cpu_to_le16(2)) + || !sle16_eq(rp->minor_ver, const_cpu_to_le16(0)))) { ntfs_log_error("$LogFile version %i.%i is not " "supported.\n (This driver supports version " "1.1 and 2.0 only.)\n", diff --git a/ntfsprogs/ntfsdump_logfile.c b/ntfsprogs/ntfsdump_logfile.c index 279ebac2..a91483ba 100644 --- a/ntfsprogs/ntfsdump_logfile.c +++ b/ntfsprogs/ntfsdump_logfile.c @@ -511,8 +511,8 @@ rstr_pass_loc: * The $LogFile versions specified in each of the two restart * page headers must match. */ - if (rstr1->major_ver != rstr->major_ver || - rstr1->minor_ver != rstr->minor_ver) + if (!sle16_eq(rstr1->major_ver, rstr->major_ver) || + !sle16_eq(rstr1->minor_ver, rstr->minor_ver)) log_err_exit(buf, "Second restart area specifies " "different $LogFile version to first " "restart area. Cannot handle this "