Accepting request 714435 from home:anicka:branches:Base:System

- changed: parted-fix-crash-due-to-improper-partition-number-in.patch
  Changed the patch to behave in the same way like before last change
  for numbers with leading zeroes.

OBS-URL: https://build.opensuse.org/request/show/714435
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=143
This commit is contained in:
Marcus Meissner 2019-07-26 09:00:45 +00:00 committed by Git OBS Bridge
parent 5b97712c80
commit f6d84ad297
2 changed files with 19 additions and 11 deletions

View File

@ -23,10 +23,10 @@ Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
parted/ui.c | 26 ++++++++++++++++++++++----
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/parted/ui.c b/parted/ui.c
index 505b8ac..5d76c20 100644
--- a/parted/ui.c
+++ b/parted/ui.c
Index: parted-3.2/parted/ui.c
===================================================================
--- parted-3.2.orig/parted/ui.c
+++ parted-3.2/parted/ui.c
@@ -29,6 +29,8 @@
#include <unistd.h>
#include <setjmp.h>
@ -36,7 +36,7 @@ index 505b8ac..5d76c20 100644
#include "command.h"
#include "strlist.h"
@@ -909,16 +911,30 @@ command_line_get_integer (const char* prompt, int* value)
@@ -912,16 +914,34 @@ command_line_get_integer (const char* pr
{
char def_str [10];
char* input;
@ -51,7 +51,11 @@ index 505b8ac..5d76c20 100644
- valid = sscanf (input, "%d", value);
+
+ errno = 0;
+ ret = strtol (input, (char**) NULL, 0);
+
+ if (strstr(input, "0x") == input)
+ ret = strtol (input, (char**) NULL, 16);
+ else
+ ret = strtol (input, (char**) NULL, 10);
+ if (errno)
+ goto error;
+
@ -70,7 +74,7 @@ index 505b8ac..5d76c20 100644
}
int
@@ -1029,6 +1045,7 @@ command_line_get_partition (const char* prompt, PedDisk* disk,
@@ -1031,6 +1051,7 @@ command_line_get_partition (const char*
PedPartition** value)
{
PedPartition* part;
@ -78,7 +82,7 @@ index 505b8ac..5d76c20 100644
/* Flawed logic, doesn't seem to work?!
check = ped_disk_next_partition (disk, part);
@@ -1045,7 +1062,8 @@ command_line_get_partition (const char* prompt, PedDisk* disk,
@@ -1047,7 +1068,8 @@ command_line_get_partition (const char*
*/
int num = (*value) ? (*value)->num : 0;
@ -88,6 +92,3 @@ index 505b8ac..5d76c20 100644
ped_exception_throw (PED_EXCEPTION_ERROR,
PED_EXCEPTION_CANCEL,
_("Expecting a partition number."));
--
2.16.4

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jul 10 10:16:16 UTC 2019 - Anna Maresova <anicka@suse.com>
- changed: parted-fix-crash-due-to-improper-partition-number-in.patch
Changed the patch to behave in the same way like before last change
for numbers with leading zeroes.
-------------------------------------------------------------------
Mon Jul 1 14:14:36 UTC 2019 - Anna Maresova <anicka@suse.com>