From e2bd0b4da44b6fbd728c9f7d7b052e194aeb53ac Mon Sep 17 00:00:00 2001 From: wenyuzifangtest001 Date: Mon, 15 Sep 2025 10:34:48 +0800 Subject: [PATCH] Update code from upstream --- gdisk-1.0.9-poptmisuse.patch | 12 ++++++++++++ gdisk.spec | 9 ++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 gdisk-1.0.9-poptmisuse.patch diff --git a/gdisk-1.0.9-poptmisuse.patch b/gdisk-1.0.9-poptmisuse.patch new file mode 100644 index 0000000..5056681 --- /dev/null +++ b/gdisk-1.0.9-poptmisuse.patch @@ -0,0 +1,12 @@ +diff -up gptfdisk-1.0.9/gptcl.cc.poptabuse gptfdisk-1.0.9/gptcl.cc +--- gptfdisk-1.0.9/gptcl.cc.poptabuse 2022-08-24 09:08:42.220778357 +0300 ++++ gptfdisk-1.0.9/gptcl.cc 2022-08-24 09:08:53.284872567 +0300 +@@ -156,6 +156,8 @@ int GPTDataCL::DoOptions(int argc, char* + + // Assume first non-option argument is the device filename.... + device = (char*) poptGetArg(poptCon); ++ if (device != NULL) ++ device = strdup(device); + poptResetContext(poptCon); + + if (device != NULL) { diff --git a/gdisk.spec b/gdisk.spec index 2b1cd12..74d5c0a 100644 --- a/gdisk.spec +++ b/gdisk.spec @@ -1,13 +1,14 @@ -%define anolis_release 1 +%define anolis_release 2 Name: gdisk -Version: 1.0.9 +Version: 1.0.9 Release: %{anolis_release}%{?dist} Summary: An fdisk-like partitioning tool for GPT disks License: GPLv2 URL: http://www.rodsbooks.com/gdisk/ -Source0: http://downloads.sourceforge.net/gptfdisk/gptfdisk-%{version}.tar.gz +Source0: http://downloads.sourceforge.net/gptfdisk/gptfdisk-1.0.9.tar.gz +Patch1: gdisk-1.0.9-poptmisuse.patch BuildRequires: gcc-c++ BuildRequires: make @@ -56,6 +57,8 @@ done %doc NEWS README %changelog +* Mon Sep 15 2025 wenyuzifangtest001 - 1.0.9-2 +- Apply patch to avoid use-after-free bugs and ensure safe memory handling for device arguments * Mon Feb 13 2023 Feng Su - 1.0.9-1 - update to v1.0.9 - add api/abi files -- Gitee