emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#22920: closed ([PATCH] libparted/disk.c(ped_disk_g


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#22920: closed ([PATCH] libparted/disk.c(ped_disk_get_partition): Fix assert error)
Date: Fri, 15 Apr 2016 01:03:02 +0000

Your message dated Thu, 14 Apr 2016 21:02:37 -0400
with message-id <address@hidden>
and subject line Re: bug#22920: [PATCH] 
libparted/disk.c(ped_disk_get_partition): Fix assert error
has caused the debbugs.gnu.org bug report #22920,
regarding [PATCH] libparted/disk.c(ped_disk_get_partition): Fix assert error
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
22920: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22920
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] libparted/disk.c(ped_disk_get_partition): Fix assert error Date: Sun, 6 Mar 2016 14:48:27 +0800
From: Xi Lu <address@hidden>

if forget create a partition, and execute:

`name 1 grub`

ped_disk_get_partition() will trigger an exception:

  Assertion (disk != NULL)
---
 libparted/disk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libparted/disk.c b/libparted/disk.c
index fe82f44..9f36d10 100644
--- a/libparted/disk.c
+++ b/libparted/disk.c
@@ -1594,7 +1594,10 @@ ped_disk_get_partition (const PedDisk* disk, int num)
 {
        PedPartition*   walk;
 
-       PED_ASSERT (disk != NULL);
+        if (disk == NULL) {
+          fprintf(stderr, "you must specify partition.");
+          return NULL;
+        }
 
        for (walk = disk->part_list; walk;
             walk = ped_disk_next_partition (disk, walk)) {
-- 
2.5.0






--- End Message ---
--- Begin Message --- Subject: Re: bug#22920: [PATCH] libparted/disk.c(ped_disk_get_partition): Fix assert error Date: Thu, 14 Apr 2016 21:02:37 -0400 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

It seems this was already fixed:

 commit f5c628dd51c7d77ff939554425159ab6e8aef1c0
 Author: Brian C. Lane <address@hidden>
 Date:   Mon Jul 13 16:43:11 2015 -0700

     parted: Fix crash with name command and no disklabel (#1226067)

     A typo (the last I think) from commit 7eac058 wasn't properly
checking
     the result of ped_disk_new so it could crash if there was no
disklabel
     on the device.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCgAGBQJXED2tAAoJEBB5UWFcu6UWw7YH/23Dl08RpAfcRiFmEYVbzkae
ZHLEDUOuebwhB9CQ5lCzzdE0tneXPg3z8LHYaQTxmmS3lqeZCKpcrmuNK0UHRGxU
iAC42Lou36nVThRFlaE4kY0soFevPiLj3+qIYrVtG9jLc8eZQQipwA4779/FQ4u3
6Pnvkr2Oj6zH8+U5L7Y+AGBcjBZlxCmQzA0vfrNjoe2FYC7QY+4gnriT215J/auX
OUPcj8wH0GK7YimT48e5aKeheIZbPHKN18J5t9wsg0k6LaWsj427uxsXQugTHVZj
iLI6qYBSjMWKX80Qd1ceXBkKtSGep7UalIfpWHk94rs7H+SutFpWV4wXQcu0w4s=
=mxV9
-----END PGP SIGNATURE-----


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]