From f7e54bdd94d9936e5bcacf79e737327d140ed8aa Mon Sep 17 00:00:00 2001 From: wenyuzifang Date: Fri, 22 Aug 2025 00:33:42 +0800 Subject: [PATCH] Update code from upstream --- gdisk-1.0.9-poptmisuse.patch | 12 ++++++++++++ gdisk.spec | 7 +++++-- 2 files changed, 17 insertions(+), 2 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..11a2598 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 +Patch1: gdisk-1.0.9-poptmisuse.patch BuildRequires: gcc-c++ BuildRequires: make @@ -56,6 +57,8 @@ done %doc NEWS README %changelog +* Fri Aug 22 2025 wenyuzifang - 1.0.9-2 +- Apply patch to prevent dangling pointer bugs and ensure memory safety * Mon Feb 13 2023 Feng Su - 1.0.9-1 - update to v1.0.9 - add api/abi files -- Gitee