From 16f3bfa6b5f10408653e16ae2c5de66995b87605 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 13 Jun 2014 23:44:01 -0500 Subject: [PATCH] extract.c: Do endian conversion when checking pipable WIM header --- src/extract.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extract.c b/src/extract.c index 42a52eb5..c312429c 100644 --- a/src/extract.c +++ b/src/extract.c @@ -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)); -- 2.43.0