]> wimlib.net Git - wimlib/commitdiff
extract.c: Do endian conversion when checking pipable WIM header
authorEric Biggers <ebiggers3@gmail.com>
Sat, 14 Jun 2014 04:44:01 +0000 (23:44 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 14 Jun 2014 04:54:51 +0000 (23:54 -0500)
src/extract.c

index 42a52eb54ccf312398e5d85f16b9bfa7a94bda3a..c312429cc7e9555e48ee43e514d9269219e5b24e 100644 (file)
@@ -131,7 +131,9 @@ read_pwm_stream_header(WIMStruct *pwm, struct wim_lookup_table_entry *lte,
        if (ret)
                goto read_error;
 
-       if ((flags & PWM_ALLOW_WIM_HDR) && buf.stream_hdr.magic == PWM_MAGIC) {
+       if ((flags & PWM_ALLOW_WIM_HDR) &&
+           le64_to_cpu(buf.stream_hdr.magic) == PWM_MAGIC)
+       {
                BUILD_BUG_ON(sizeof(buf.pwm_hdr) < sizeof(buf.stream_hdr));
                ret = full_read(&pwm->in_fd, &buf.stream_hdr + 1,
                                sizeof(buf.pwm_hdr) - sizeof(buf.stream_hdr));