diff --git a/0030-enhance-pointer-safe.patch b/0030-enhance-pointer-safe.patch new file mode 100644 index 0000000000000000000000000000000000000000..fdcaf9c2767028cf569a3b67a6c7ebbbfa379e87 --- /dev/null +++ b/0030-enhance-pointer-safe.patch @@ -0,0 +1,33 @@ +From 9cf127b4297b8d0e4f3fd34c264d7b1648bad77f Mon Sep 17 00:00:00 2001 +From: Zdenek Kabelac +Date: Fri, 3 May 2024 12:38:39 +0200 +Subject: [PATCH] const: suffixes + +--- + tools/lvmcmdline.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c +index 66b269538..38e3ce190 100644 +--- a/tools/lvmcmdline.c ++++ b/tools/lvmcmdline.c +@@ -576,7 +576,7 @@ static int _size_arg(struct cmd_context *cmd __attribute__((unused)), + { + char *ptr; + int i; +- static const char *suffixes = "kmgtpebs"; ++ static const char _suffixes[] = "kmgtpebs"; + char *val; + double v; + uint64_t v_tmp, adjustment; +@@ -636,8 +636,8 @@ static int _size_arg(struct cmd_context *cmd __attribute__((unused)), + return 0; + } + } else if (*ptr) { +- for (i = strlen(suffixes) - 1; i >= 0; i--) +- if (suffixes[i] == tolower((int) *ptr)) ++ for (i = sizeof(_suffixes) - 1; i >= 0; --i) ++ if (_suffixes[i] == tolower((int) *ptr)) + break; + + if (i < 0) { diff --git a/lvm2.spec b/lvm2.spec index c4ba03136a3a9d8a2b1222a873318d839738102a..d9731c8d97ffa82c675d3be2a7e1fbe3ff989a04 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.21 -Release: 20 +Release: 21 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -78,6 +78,7 @@ Patch26: 0026-fix-pv_major-and-pv_minor-report-field-type.patch Patch27: 0027-vgsplit-fix-check-for-not-splitting-an-LV-between-tw.patch Patch28: 0028-vgsplit-fix-check-for-not-splitting-an-LV-between-tw.patch Patch29: 0029-add-internal-error-for-missing-vg.patch +Patch30: 0030-enhance-pointer-safe.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -504,6 +505,9 @@ fi %changelog +* Thu Nov 13 2025 weishuaihao - 8:2.03.21-21 +- enhance pointer safe + * Wed Nov 12 2025 weishuaihao - 8:2.03.21-20 - add internal error for missing vg