git/backport-CVE-2022-41903-test-lib-add-prerequisite-for-64-bit-platforms.patch
fly_fzc d11f2884e5 Fix CVE-2022-23521 CVE-2022-41903
(cherry picked from commit df506cf2f7ba0d39fd1e45649c252bfd23fadd6e)
2023-01-28 10:25:57 +08:00

39 lines
1.1 KiB
Diff

From a244dc5b0a629290881641467c7a545de7508ab2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= <carenas@gmail.com>
Date: Tue, 2 Nov 2021 15:46:06 +0000
Subject: [PATCH] test-lib: add prerequisite for 64-bit platforms
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Allow tests that assume a 64-bit `size_t` to be skipped in 32-bit
platforms and regardless of the size of `long`.
This imitates the `LONG_IS_64BIT` prerequisite.
Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
t/test-lib.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 9fa7c1d0f6..7d6e0f89d1 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1686,6 +1686,10 @@ build_option () {
sed -ne "s/^$1: //p"
}
+test_lazy_prereq SIZE_T_IS_64BIT '
+ test 8 -eq "$(build_option sizeof-size_t)"
+'
+
test_lazy_prereq LONG_IS_64BIT '
test 8 -le "$(build_option sizeof-long)"
'
--
2.27.0