Prevent crash when creating new partition on loop label (#721988)
Write a loop partition table to a disk and then try to create a new partition on that disk crashes GParted. Analysis: 1) Loop partition table, actually just the signature / label "GNU Parted Loopback 0", is written to the disk. 2) create_partition() calls ped_disk_app_partition() to create the partition which, arguably erroneously, clears the loop signature. 3) In erase_filesystem_signatures(), get_device_and_disk() fails because there's no longer a loop signature for libparted to recognise. This leaves lp_device, lp_disk and lp_partition = NULL, but incorrectly overall_success = true. 4) Overall_success = true allows the signature erasure loop to run and evaluate lp_device->sector_size, dereferencing a NULL pointer and crashing GParted. Fix erase_filesystem_signatures() to correctly handle failure from get_device_and_disk(), broken by this commit: 246e0555 Clear btrfs file system super block mirror copies too (#705426) Bug #721988 - Crash when creating new partition on disk with loop label
parent
f439a31a
Please register or sign in to comment