[parted-devel] [PATCH 2/2] Fix end_input usage in do_resizepart
Brian C. Lane
bcl at redhat.com
Tue Apr 23 22:16:00 BST 2019
It needs to be set to NULL, since it may not get set by the call to
command_line_get_sector
---
parted/parted.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parted/parted.c b/parted/parted.c
index fe7c26d..39fdfef 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1548,6 +1548,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
PedGeometry *range_end = NULL;
PedConstraint* constraint;
int rc = 0;
+ char* end_input = NULL;
if (!disk) {
disk = ped_disk_new (*dev);
@@ -1568,8 +1569,7 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
start = part->geom.start;
end = oldend = part->geom.end;
- char *end_input;
- if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input))
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input) )
goto error;
_adjust_end_if_iec(&start, &end, range_end, end_input);
free(end_input);
--
2.20.1
More information about the parted-devel
mailing list