slackware-current/source/a/gptfdisk/popt-1.19-follow-up.patch
Patrick J Volkerding 668a929acf Fri Dec 2 06:58:38 UTC 2022
a/gptfdisk-1.0.9-x86_64-2.txz:  Rebuilt.
  Applied upstream patches to fix a crash and partition corruption caused by
  the popt upgrade:
  [PATCH] Updated guid.cc to deal with minor change in libuuid
  [PATCH] Fix failure & crash of sgdisk when compiled with latest popt
  [PATCH] Fix NULL dereference when duplicating string argument
  Thanks to jloco.
d/cmake-3.25.1-x86_64-1.txz:  Upgraded.
kde/calligra-3.2.1-x86_64-24.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
kde/cantor-22.08.3-x86_64-2.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
kde/kfilemetadata-5.100.0-x86_64-2.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
kde/kile-2.9.93-x86_64-22.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
kde/kitinerary-22.08.3-x86_64-2.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
kde/krita-5.1.3-x86_64-2.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
kde/okular-22.08.3-x86_64-2.txz:  Rebuilt.
  Recompiled against poppler-22.12.0.
l/glib2-2.74.3-x86_64-1.txz:  Upgraded.
l/poppler-22.12.0-x86_64-1.txz:  Upgraded.
  Shared library .so-version bump.
n/NetworkManager-1.40.6-x86_64-1.txz:  Upgraded.
xap/NetworkManager-openvpn-1.10.2-x86_64-1.txz:  Upgraded.
xap/libnma-1.10.4-x86_64-1.txz:  Upgraded.
xap/network-manager-applet-1.30.0-x86_64-1.txz:  Upgraded.
2022-12-02 16:59:51 +01:00

37 lines
1.3 KiB
Diff

From f5de3401b974ce103ffd93af8f9d43505a04aaf9 Mon Sep 17 00:00:00 2001
From: Damian Kurek <starfire24680@gmail.com>
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
---
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;