Skip to content
Commit 5e027d69 authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak
Browse files

Assert selected_partition_ptr is not NULL (#750168)

Add Glib g_assert() to ensure that a bug doesn't get introduced which
allows a partition callback to be called without a partition being
selected first.

After deliberately breaking the code so that selected_partition_ptr is
not set, trying to display the Information dialog causes this crash:

    # ./gpartedbin
    ======================
    libparted : 2.4
    ======================
    ERROR:Win_GParted.cc:1978:void GParted::Win_GParted::activate_info(): assertion failed: (selected_partition_ptr != NULL)
    Aborted (core dumped)

At this point in the code:

   1976  void Win_GParted::activate_info()
   1977  {
>> 1978          g_assert( selected_partition_ptr != NULL );  // Bug: Partition callback without a selected partition
   1979

Bug 750168 - Reduce the amount of copying of partition objects
parent da39e3ca
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment