Merge lp:~khurshid-alam/unity-control-center/info-panel-fix into lp:unity-control-center

Proposed by Khurshid Alam on 2019-03-16
Status: Merged
Approved by: Sebastien Bacher on 2019-04-01
Approved revision: 12920
Merged at revision: 12920
Proposed branch: lp:~khurshid-alam/unity-control-center/info-panel-fix
Merge into: lp:unity-control-center
Diff against target: 54 lines (+28/-4)
1 file modified
panels/info/cc-info-panel.c (+28/-4)
To merge this branch: bzr merge lp:~khurshid-alam/unity-control-center/info-panel-fix
Reviewer Review Type Date Requested Status
Sebastien Bacher 2019-03-16 Approve on 2019-04-01
Review via email: mp+364613@code.launchpad.net

Commit message

info: Fix crashes when retrieving disk size
The panel crashes against glib >= 2.59.2 because GUnixMountPoint is by mistake used as GUnixMountEntry.

See https://gitlab.gnome.org/GNOME/gnome-control-center/merge_requests/432

To post a comment you must log in.
Sebastien Bacher (seb128) wrote :

looks fine indeed

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'panels/info/cc-info-panel.c'
--- panels/info/cc-info-panel.c 2016-06-12 12:50:32 +0000
+++ panels/info/cc-info-panel.c 2019-03-16 07:33:01 +0000
@@ -579,14 +579,38 @@
579 g_object_unref (file);579 g_object_unref (file);
580}580}
581581
582static GList *
583convert_points_to_entries (GList *points)
584{
585 GList *entries = NULL;
586 GList *p;
587
588 for (p = points; p != NULL; p = p->next)
589 {
590 GUnixMountPoint *point = p->data;
591 GUnixMountEntry *mount;
592 const gchar *mount_path = g_unix_mount_point_get_mount_path (point);
593
594 mount = g_unix_mount_at (mount_path, NULL);
595 if (mount)
596 entries = g_list_append (entries, mount);
597 }
598
599 return entries;
600}
601
582static void602static void
583get_primary_disc_info (CcInfoPanel *self)603get_primary_disc_info (CcInfoPanel *self)
584{604{
585 GList *points;605 GList *points, *entries = NULL;
586 GList *p;606 GList *p;
587607
588 points = g_unix_mount_points_get (NULL);608 points = g_unix_mount_points_get (NULL);
589 for (p = points; p != NULL; p = p->next)609
610 entries = convert_points_to_entries (points);
611 g_list_free_full (points, (GDestroyNotify) g_unix_mount_point_free);
612
613 for (p = entries; p != NULL; p = p->next)
590 {614 {
591 GUnixMountEntry *mount = p->data;615 GUnixMountEntry *mount = p->data;
592 const char *mount_path;616 const char *mount_path;
@@ -604,7 +628,7 @@
604628
605 self->priv->primary_mounts = g_list_prepend (self->priv->primary_mounts, mount);629 self->priv->primary_mounts = g_list_prepend (self->priv->primary_mounts, mount);
606 }630 }
607 g_list_free (points);631 g_list_free (entries);
608632
609 get_primary_disc_info_start (self);633 get_primary_disc_info_start (self);
610}634}

Subscribers

People subscribed via source and target branches