parent
3f05cb17ac
commit
ea588861e0
@ -0,0 +1,37 @@
|
||||
From f3906fd616c92168c63bb92accc72e79a24b0c04 Mon Sep 17 00:00:00 2001
|
||||
From: Martin <martin@urbackup.org>
|
||||
Date: Sun, 28 Nov 2021 18:37:55 +0100
|
||||
Subject: [PATCH] Fix unaligned pointer access
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Petr Písař: Ported to 2.2.0.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
miniz.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/miniz.c b/miniz.c
|
||||
index af27389..071367f 100644
|
||||
--- a/miniz.c
|
||||
+++ b/miniz.c
|
||||
@@ -7118,10 +7118,10 @@ mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *
|
||||
if (pZip->m_pState->m_zip64)
|
||||
{
|
||||
/* dest is zip64, so upgrade the data descriptor */
|
||||
- const mz_uint32 *pSrc_descriptor = (const mz_uint32 *)((const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0));
|
||||
- const mz_uint32 src_crc32 = pSrc_descriptor[0];
|
||||
- const mz_uint64 src_comp_size = pSrc_descriptor[1];
|
||||
- const mz_uint64 src_uncomp_size = pSrc_descriptor[2];
|
||||
+ const mz_uint8 *pSrc_descriptor = (const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0);
|
||||
+ const mz_uint32 src_crc32 = MZ_READ_LE32(pSrc_descriptor);
|
||||
+ const mz_uint64 src_comp_size = MZ_READ_LE32(pSrc_descriptor + sizeof(mz_uint32));
|
||||
+ const mz_uint64 src_uncomp_size = MZ_READ_LE32(pSrc_descriptor + 2*sizeof(mz_uint32));
|
||||
|
||||
mz_write_le32((mz_uint8 *)pBuf, MZ_ZIP_DATA_DESCRIPTOR_ID);
|
||||
mz_write_le32((mz_uint8 *)pBuf + sizeof(mz_uint32) * 1, src_crc32);
|
||||
--
|
||||
2.34.1
|
||||
|
Loading…
Reference in new issue