9be6cb8f21d9e45fc9685c12c62625ecbb1e0404
[busybox-power] / debian / patches / hotfixes / busybox-1.21.0-platform.patch
1 --- busybox-1.21.0/archival/libarchive/decompress_unxz.c
2 +++ busybox-1.21.0-platform/archival/libarchive/decompress_unxz.c
3 @@ -30,8 +30,8 @@ static uint32_t xz_crc32(const uint8_t *
4  /* We use arch-optimized unaligned accessors */
5  #define get_unaligned_le32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_LE32(v); })
6  #define get_unaligned_be32(buf) ({ uint32_t v; move_from_unaligned32(v, buf); SWAP_BE32(v); })
7 -#define put_unaligned_le32(val, buf) move_to_unaligned16(buf, SWAP_LE32(val))
8 -#define put_unaligned_be32(val, buf) move_to_unaligned16(buf, SWAP_BE32(val))
9 +#define put_unaligned_le32(val, buf) move_to_unaligned32(buf, SWAP_LE32(val))
10 +#define put_unaligned_be32(val, buf) move_to_unaligned32(buf, SWAP_BE32(val))
11  
12  #include "unxz/xz_dec_bcj.c"
13  #include "unxz/xz_dec_lzma2.c"
14 --- busybox-1.21.0/include/platform.h
15 +++ busybox-1.21.0-platform/include/platform.h
16 @@ -228,7 +228,7 @@ typedef uint32_t bb__aliased_uint32_t FI
17  # define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
18  # define move_to_unaligned16(u16p, v) do { \
19         uint16_t __t = (v); \
20 -       memcpy((u16p), &__t, 4); \
21 +       memcpy((u16p), &__t, 2); \
22  } while (0)
23  # define move_to_unaligned32(u32p, v) do { \
24         uint32_t __t = (v); \