It’s not a backport as source comes from source forge. Please check other
patches to see the upstream situation and correct the status.

Alex

On Thu 19. Jan 2023 at 14.20, Markus Volk <[email protected]> wrote:

> 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
>
> Signed-off-by: Markus Volk <[email protected]>
> ---
>  .../fdisk/gptfdisk/popt-1.19-follow-up.patch  | 42 +++++++++++++++++++
>  meta/recipes-devtools/fdisk/gptfdisk_1.0.9.bb |  1 +
>  2 files changed, 43 insertions(+)
>  create mode 100644
> meta/recipes-devtools/fdisk/gptfdisk/popt-1.19-follow-up.patch
>
> 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..a5ccd2385a
> --- /dev/null
> +++ b/meta/recipes-devtools/fdisk/gptfdisk/popt-1.19-follow-up.patch
> @@ -0,0 +1,42 @@
> +From f5de3401b974ce103ffd93af8f9d43505a04aaf9 Mon Sep 17 00:00:00 2001
> +From: Damian Kurek <[email protected]>
> +Date: Thu, 7 Jul 2022 03:39:16 +0000
> +Subject: [PATCH] Fix NULL dereference when duplicating string argument
> +
> +poptGetArg can return NULL if there are no additional arguments, which
> +makes strdup dereference NULL on strlen
> +
> +Upstream-Status: Backport [
> https://github.com/archlinux/svntogit-packages/tree/packages/gptfdisk/trunk
> ]
> +
> +Unsure if this patch is really a backport yet. It was taken from Archlinux
> +---
> + gptcl.cc | 6 ++++--
> + 1 file changed, 4 insertions(+), 2 deletions(-)
> +
> +diff --git a/gptcl.cc b/gptcl.cc
> +index 0d578eb..ab95239 100644
> +--- a/gptcl.cc
> ++++ b/gptcl.cc
> +@@ -155,10 +155,11 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
> +    } // while
> +
> +    // Assume first non-option argument is the device filename....
> +-   device = strdup((char*) poptGetArg(poptCon));
> +-   poptResetContext(poptCon);
> ++   device = (char*) poptGetArg(poptCon);
> +
> +    if (device != NULL) {
> ++      device = strdup(device);
> ++      poptResetContext(poptCon);
> +       JustLooking(); // reset as necessary
> +       BeQuiet(); // Tell called functions to be less verbose &
> interactive
> +       if (LoadPartitions((string) device)) {
> +@@ -498,6 +499,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
> +          cerr << "Error encountered; not saving changes.\n";
> +          retval = 4;
> +       } // if
> ++      free(device);
> +    } // if (device != NULL)
> +    poptFreeContext(poptCon);
> +    return retval;
> +
> 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 \
>
> file://0001-Updated-guid.cc-to-deal-with-minor-change-in-libuuid.patch \
>
> file://0001-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch \
>             file://0001-Use-64bit-time_t-on-linux-as-well.patch \
> +           file://popt-1.19-follow-up.patch \
>             "
>  SRC_URI[sha256sum] =
> "dafead2693faeb8e8b97832b23407f6ed5b3219bc1784f482dd855774e2d50c2"
>
> --
> 2.34.1
>
>
> 
>
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#176145): 
https://lists.openembedded.org/g/openembedded-core/message/176145
Mute This Topic: https://lists.openembedded.org/mt/96376633/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to