0002-Fix-failure-crash-of-sgdisk-when-compiled-with-lates.patch 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From 5d5e76d369a412bfb3d2cebb5fc0a7509cef878d Mon Sep 17 00:00:00 2001
  2. From: Rod Smith <rodsmith@rodsbooks.com>
  3. Date: Fri, 15 Apr 2022 18:10:14 -0400
  4. Subject: [PATCH] Fix failure & crash of sgdisk when compiled with latest
  5. popt (commit 740; presumably eventually release 1.19)
  6. [Retrieved from:
  7. https://sourceforge.net/p/gptfdisk/code/ci/5d5e76d369a412bfb3d2cebb5fc0a7509cef878d/]
  8. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  9. ---
  10. NEWS | 8 ++++++++
  11. gptcl.cc | 2 +-
  12. support.h | 2 +-
  13. 3 files changed, 10 insertions(+), 2 deletions(-)
  14. diff --git a/NEWS b/NEWS
  15. index c7add56..9e153fd 100644
  16. --- a/NEWS
  17. +++ b/NEWS
  18. @@ -1,3 +1,11 @@
  19. +1.0.10 (?/??/2022):
  20. +-------------------
  21. +
  22. +- Fixed problem that caused sgdisk to crash with errors about being unable
  23. + to read the disk's partition table when compiled with the latest popt
  24. + (commit 740, which is pre-release as I type; presumably version 1.19 and
  25. + later once released).
  26. +
  27. 1.0.9 (4/14/2022):
  28. ------------------
  29. diff --git a/gptcl.cc b/gptcl.cc
  30. index 34c9421..0d578eb 100644
  31. --- a/gptcl.cc
  32. +++ b/gptcl.cc
  33. @@ -155,7 +155,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
  34. } // while
  35. // Assume first non-option argument is the device filename....
  36. - device = (char*) poptGetArg(poptCon);
  37. + device = strdup((char*) poptGetArg(poptCon));
  38. poptResetContext(poptCon);
  39. if (device != NULL) {
  40. diff --git a/support.h b/support.h
  41. index 8ba9ad1..f91f1bc 100644
  42. --- a/support.h
  43. +++ b/support.h
  44. @@ -8,7 +8,7 @@
  45. #include <stdlib.h>
  46. #include <string>
  47. -#define GPTFDISK_VERSION "1.0.9"
  48. +#define GPTFDISK_VERSION "1.0.9.1"
  49. #if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
  50. // Darwin (Mac OS) & FreeBSD: disk IOCTLs are different, and there is no lseek64
  51. --
  52. 2.35.1