From 3ee0bc5084059de04941a3dbdbf966c01cd111ec Mon Sep 17 00:00:00 2001 From: caodongxia <315816521@qq.com> Date: Thu, 3 Jun 2021 10:37:25 +0800 Subject: [PATCH] fix issue (cherry picked from commit 4378d2177e36b8ae289d312a9e527068d999332b) --- 0008-left-shift.patch | 62 +++++++++++++++++++++++++++++++++++++++++++ sleuthkit.spec | 6 ++++- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 0008-left-shift.patch diff --git a/0008-left-shift.patch b/0008-left-shift.patch new file mode 100644 index 0000000..85bce3b --- /dev/null +++ b/0008-left-shift.patch @@ -0,0 +1,62 @@ +From 86b8f475811a20a477801a50eada3b43fb3129ea Mon Sep 17 00:00:00 2001 +From: caodongxia <315816521@qq.com> +Date: Wed, 2 Jun 2021 19:18:22 +0800 +Subject: [PATCH] create patch + +--- + tsk/base/tsk_base_i.h | 24 ++++++++++++------------ + 1 file changed, 12 insertions(+), 12 deletions(-) + +diff --git a/tsk/base/tsk_base_i.h b/tsk/base/tsk_base_i.h +index 147ef13..de86b32 100644 +--- a/tsk/base/tsk_base_i.h ++++ b/tsk/base/tsk_base_i.h +@@ -79,8 +79,8 @@ extern "C" { + */ + #define tsk_getu16(endian, x) \ + (uint16_t)(((endian) == TSK_LIT_ENDIAN) ? \ +- (((uint8_t *)(x))[0] + (((uint8_t *)(x))[1] << 8)) : \ +- (((uint8_t *)(x))[1] + (((uint8_t *)(x))[0] << 8)) ) ++ (((uint8_t *)(x))[0] + ((unsigned int)(((uint8_t *)(x))[1]) << 8)) : \ ++ (((uint8_t *)(x))[1] + ((unsigned int)(((uint8_t *)(x))[0]) << 8)) ) + + /** \internal + * Read a 16-bit signed value. +@@ -99,8 +99,8 @@ extern "C" { + */ + #define tsk_getu24(endian, x) \ + (uint32_t)(((endian) == TSK_LIT_ENDIAN) ? \ +- (((uint8_t *)(x))[0] + (((uint8_t *)(x))[1] << 8) + (((uint8_t *)(x))[2] << 16)) : \ +- (((uint8_t *)(x))[2] + (((uint8_t *)(x))[1] << 8) + (((uint8_t *)(x))[0] << 16)) ) ++ (((uint8_t *)(x))[0] + ((unsigned int)(((uint8_t *)(x))[1]) << 8) + ((unsigned int)(((uint8_t *)(x))[2]) << 16)) : \ ++ (((uint8_t *)(x))[2] + ((unsigned int)(((uint8_t *)(x))[1]) << 8) + ((unsigned int)(((uint8_t *)(x))[0]) << 16)) ) + + + +@@ -112,15 +112,15 @@ extern "C" { + */ + #define tsk_getu32(endian, x) \ + (uint32_t)( ((endian) == TSK_LIT_ENDIAN) ? \ +- ((((uint8_t *)(x))[0] << 0) + \ +- (((uint8_t *)(x))[1] << 8) + \ +- (((uint8_t *)(x))[2] << 16) + \ +- (((uint8_t *)(x))[3] << 24) ) \ ++ (((unsigned int)(((uint8_t *)(x))[0]) << 0) + \ ++ ((unsigned int)(((uint8_t *)(x))[1]) << 8) + \ ++ ((unsigned int)(((uint8_t *)(x))[2]) << 16) + \ ++ ((unsigned int)(((uint8_t *)(x))[3]) << 24) ) \ + : \ +- ((((uint8_t *)(x))[3] << 0) + \ +- (((uint8_t *)(x))[2] << 8) + \ +- (((uint8_t *)(x))[1] << 16) + \ +- (((uint8_t *)(x))[0] << 24) ) ) ++ (((unsigned int)(((uint8_t *)(x))[3]) << 0) + \ ++ ((unsigned int)(((uint8_t *)(x))[2]) << 8) + \ ++ ((unsigned int)(((uint8_t *)(x))[1]) << 16) + \ ++ ((unsigned int)(((uint8_t *)(x))[0]) << 24) ) ) + + /** \internal + * Read a 32-bit signed value. +-- +2.27.0 + diff --git a/sleuthkit.spec b/sleuthkit.spec index 2e6c380..3aa3402 100644 --- a/sleuthkit.spec +++ b/sleuthkit.spec @@ -1,6 +1,6 @@ Name: sleuthkit Version: 4.6.7 -Release: 6 +Release: 7 Summary: Tools for file system and volume forensic analysis License: CPL and IBM and GPLv2+ URL: http://www.sleuthkit.org @@ -13,6 +13,7 @@ Patch4: 0004-Cast-attrseq-address-to-uintptr_t-so-that-the-correc.patch Patch5: 0005-Fix-Fuzz-buffer-overflow.patch Patch6: 0006-Add-attributes-file-nodesize-check.patch Patch7: 0007-Fixed-OOB-reads-in-hfs_cat_traverse.patch +Patch8: 0008-left-shift.patch BuildRequires: gcc-c++ afflib-devel >= 3.3.4 libewf-devel perl-generators sqlite-devel @@ -87,6 +88,9 @@ sed -i.rpath 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool %{_mandir}/man1/* %changelog +* Thu Jun 3 2021 caodongxia - 4.6.7-7 +- Fixed left shift + * Wed May 19 2021 lingsheng - 4.6.7-6 - Fixed OOB reads in hfs_cat_traverse -- Gitee