|
|
8b1fd4 |
From 3a7f644f21703afcf7088a5994be1a6dff19f679 Mon Sep 17 00:00:00 2001
|
|
|
8b1fd4 |
From: "Brian C. Lane" <bcl@redhat.com>
|
|
|
8b1fd4 |
Date: Thu, 10 Jun 2021 15:51:12 -0700
|
|
|
8b1fd4 |
Subject: [PATCH 09/13] parted: Fix end_input leak in do_mkpart
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
---
|
|
|
8b1fd4 |
parted/parted.c | 5 +++--
|
|
|
8b1fd4 |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
diff --git a/parted/parted.c b/parted/parted.c
|
|
|
8b1fd4 |
index 41edb7f..e9aa240 100644
|
|
|
8b1fd4 |
--- a/parted/parted.c
|
|
|
8b1fd4 |
+++ b/parted/parted.c
|
|
|
8b1fd4 |
@@ -645,6 +645,7 @@ do_mkpart (PedDevice** dev, PedDisk** diskp)
|
|
|
8b1fd4 |
char* part_name = NULL;
|
|
|
8b1fd4 |
char *start_usr = NULL, *end_usr = NULL;
|
|
|
8b1fd4 |
char *start_sol = NULL, *end_sol = NULL;
|
|
|
8b1fd4 |
+ char *end_input = NULL;
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
if (*diskp)
|
|
|
8b1fd4 |
disk = *diskp;
|
|
|
8b1fd4 |
@@ -698,12 +699,10 @@ do_mkpart (PedDevice** dev, PedDisk** diskp)
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
if (!command_line_get_sector (_("Start?"), *dev, &start, &range_start, NULL))
|
|
|
8b1fd4 |
goto error;
|
|
|
8b1fd4 |
- char *end_input;
|
|
|
8b1fd4 |
if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input))
|
|
|
8b1fd4 |
goto error;
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
_adjust_end_if_iec(&start, &end, range_end, end_input);
|
|
|
8b1fd4 |
- free(end_input);
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
/* processing starts here */
|
|
|
8b1fd4 |
part = ped_partition_new (disk, part_type, fs_type, start, end);
|
|
|
8b1fd4 |
@@ -839,6 +838,7 @@ do_mkpart (PedDevice** dev, PedDisk** diskp)
|
|
|
8b1fd4 |
free (end_usr);
|
|
|
8b1fd4 |
free (start_sol);
|
|
|
8b1fd4 |
free (end_sol);
|
|
|
8b1fd4 |
+ free(end_input);
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
if ((*dev)->type != PED_DEVICE_FILE)
|
|
|
8b1fd4 |
disk_is_modified = 1;
|
|
|
8b1fd4 |
@@ -860,6 +860,7 @@ error:
|
|
|
8b1fd4 |
free (end_usr);
|
|
|
8b1fd4 |
free (start_sol);
|
|
|
8b1fd4 |
free (end_sol);
|
|
|
8b1fd4 |
+ free(end_input);
|
|
|
8b1fd4 |
|
|
|
8b1fd4 |
return 0;
|
|
|
8b1fd4 |
}
|
|
|
8b1fd4 |
--
|
|
|
8b1fd4 |
2.31.1
|
|
|
8b1fd4 |
|