[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: segfault in parted.c, inconsistency in 1.6.6
From: |
Michael Schwendt |
Subject: |
Re: segfault in parted.c, inconsistency in 1.6.6 |
Date: |
Wed, 15 Oct 2003 05:52:43 +0200 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tue, 14 Oct 2003 21:44:12 +0200, Michael Schwendt wrote:
> https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=106976
[Replying to my own message.]
Some news. The segmentation fault I have encountered in parted 1.6.3
seems to have been addressed in version 1.6.6.
However, the line that was moved in the do_mkpart() function in the
parted.c file is found at a different place compared with the
do_mkpartfs() function that follows. Which one is right?
In do_mkpart(), the call to ped_constraint_destroy(..) is done later
than in do_mkpartfs().
I'm not familiar with the code, but with the several goto's it can
happen that in do_mkpart() it is returned from the function without
calling ped_constraint_destroy(..) compared with do_mkpartfs().
I think the only difference between the two mkpart function should be
the file-system creation. So, why the difference with regard to
ped_constraint_destroy(..)?
[...]
Below is my second attempt at fixing the segfault in parted 1.6.3.
With it applied, parted passes my test-cases fine.
diff -Nur parted-1.6.3-orig/parted/parted.c parted-1.6.3/parted/parted.c
- --- parted-1.6.3-orig/parted/parted.c 2002-10-23 01:02:40.000000000 +0200
+++ parted-1.6.3/parted/parted.c 2003-10-15 01:40:22.000000000 +0200
@@ -543,13 +543,13 @@
goto error_destroy_part;
if (!ped_disk_add_partition (disk, part, constraint))
goto error_destroy_part;
- - ped_constraint_destroy (constraint);
if (!_solution_check_distant (start, end,
part->geom.start, part->geom.end,
_("You requested to create a partition at %.3f-%.3fMb. The "
"closest Parted can manage is %.3f-%.3fMb.")))
goto error_remove_part;
+ ped_constraint_destroy (constraint);
if (!ped_partition_set_system (part, fs_type))
goto error_destroy_disk;
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
iD8DBQE/jMSL0iMVcrivHFQRAt9UAJ0bRKaZh+ki2ilyZs6Y4bVVZvnfjACfQ3nL
7tgw1D2o6mS9XDRhVHsPrcU=
=ULrH
-----END PGP SIGNATURE-----