summaryrefslogtreecommitdiff
path: root/archival/unzip.c
diff options
context:
space:
mode:
authorNatanael Copa2017-07-25 20:44:50 +0200
committerDenys Vlasenko2017-07-27 15:38:55 +0200
commit46f3f16b587ce781ab43a7b17698e1e565b2acf7 (patch)
treef850dbea41558e353382b68d80fa90d92ca4235e /archival/unzip.c
parent5b3cbe3a535db27302d979bddefa28ca492647e9 (diff)
downloadbusybox-46f3f16b587ce781ab43a7b17698e1e565b2acf7.zip
busybox-46f3f16b587ce781ab43a7b17698e1e565b2acf7.tar.gz
unzip: fix regression on big-endian machines
This fixes a regression which was introduced with commit 2a0867a5 ("unzip: optional support for bzip2 and lzma") and causes unzip to exit with error when extracting archives: unzip: unsupported method 2048 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/unzip.c')
-rw-r--r--archival/unzip.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/archival/unzip.c b/archival/unzip.c
index bb39d95..8ed9ae7 100644
--- a/archival/unzip.c
+++ b/archival/unzip.c
@@ -114,6 +114,7 @@ typedef union {
#define FIX_ENDIANNESS_ZIP(zip) \
do { if (BB_BIG_ENDIAN) { \
+ (zip).fmt.method = SWAP_LE16((zip).fmt.method ); \
(zip).fmt.crc32 = SWAP_LE32((zip).fmt.crc32 ); \
(zip).fmt.cmpsize = SWAP_LE32((zip).fmt.cmpsize ); \
(zip).fmt.ucmpsize = SWAP_LE32((zip).fmt.ucmpsize ); \