summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/fdisk
diff options
context:
space:
mode:
authorMarkus Volk <f_l_k@t-online.de>2023-01-19 20:24:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-24 22:06:51 +0000
commita78842a19a50230ce329686d3d9b66331d8c2591 (patch)
tree932aca740374f78cd64f4e93ef3c02251eb91a52 /meta/recipes-devtools/fdisk
parent7d968ddf801879d00215d9436777a047fb4e4107 (diff)
downloadpoky-a78842a19a50230ce329686d3d9b66331d8c2591.tar.gz
gptfdisk: add follow-up patch to fix with current popt
sgdisk still segfaults for some tasks (e.g 'sgdisk -v', 'sgdisk -V') Add a follow-up patch that fixes the issue. It was taken from Archlinux (From OE-Core rev: b2f3f8ced22da68eecd7689cc09e28f70100bd56) Signed-off-by: Markus Volk <f_l_k@t-online.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/fdisk')
-rw-r--r--meta/recipes-devtools/fdisk/gptfdisk/popt-1.19-follow-up.patch41
-rw-r--r--meta/recipes-devtools/fdisk/gptfdisk_1.0.9.bb1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/fdisk/gptfdisk/popt-1.19-follow-up.patch b/meta/recipes-devtools/fdisk/gptfdisk/popt-1.19-follow-up.patch
new file mode 100644
index 0000000000..c7fa965ec9
--- /dev/null
+++ b/meta/recipes-devtools/fdisk/gptfdisk/popt-1.19-follow-up.patch
@@ -0,0 +1,41 @@
1From f5de3401b974ce103ffd93af8f9d43505a04aaf9 Mon Sep 17 00:00:00 2001
2From: Damian Kurek <starfire24680@gmail.com>
3Date: Thu, 7 Jul 2022 03:39:16 +0000
4Subject: [PATCH] Fix NULL dereference when duplicating string argument
5
6poptGetArg can return NULL if there are no additional arguments, which
7makes strdup dereference NULL on strlen
8
9Upstream-Status: Submitted [https://sourceforge.net/p/gptfdisk/code/merge-requests/28/]
10
11---
12 gptcl.cc | 6 ++++--
13 1 file changed, 4 insertions(+), 2 deletions(-)
14
15diff --git a/gptcl.cc b/gptcl.cc
16index 0d578eb..ab95239 100644
17--- a/gptcl.cc
18+++ b/gptcl.cc
19@@ -155,10 +155,11 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
20 } // while
21
22 // Assume first non-option argument is the device filename....
23- device = strdup((char*) poptGetArg(poptCon));
24- poptResetContext(poptCon);
25+ device = (char*) poptGetArg(poptCon);
26
27 if (device != NULL) {
28+ device = strdup(device);
29+ poptResetContext(poptCon);
30 JustLooking(); // reset as necessary
31 BeQuiet(); // Tell called functions to be less verbose & interactive
32 if (LoadPartitions((string) device)) {
33@@ -498,6 +499,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
34 cerr << "Error encountered; not saving changes.\n";
35 retval = 4;
36 } // if
37+ free(device);
38 } // if (device != NULL)
39 poptFreeContext(poptCon);
40 return retval;
41
diff --git a/meta/recipes-devtools/fdisk/gptfdisk_1.0.9.bb b/meta/recipes-devtools/fdisk/gptfdisk_1.0.9.bb
index 66935b7fbb..cf0a60a1a9 100644
--- a/meta/recipes-devtools/fdisk/gptfdisk_1.0.9.bb
+++ b/meta/recipes-devtools/fdisk/gptfdisk_1.0.9.bb
@@ -12,6 +12,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz \
12 file://0001-Updated-guid.cc-to-deal-with-minor-change-in-libuuid.patch \ 12 file://0001-Updated-guid.cc-to-deal-with-minor-change-in-libuuid.patch \
13 file://0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch \ 13 file://0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch \
14 file://0001-Use-64bit-time_t-on-linux-as-well.patch \ 14 file://0001-Use-64bit-time_t-on-linux-as-well.patch \
15 file://popt-1.19-follow-up.patch \
15 " 16 "
16SRC_URI[sha256sum] = "dafead2693faeb8e8b97832b23407f6ed5b3219bc1784f482dd855774e2d50c2" 17SRC_URI[sha256sum] = "dafead2693faeb8e8b97832b23407f6ed5b3219bc1784f482dd855774e2d50c2"
17 18