summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-06-11 01:38:02 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2010-06-11 01:48:00 -0400
commit7db3315e3ccfc79373ca4b032c14fa755f266634 (patch)
tree72b48babefc638858966fd6f38d88f50c93dfbdf /gui
parent5492a8310bc52cd54940426c68381f1d23273ac9 (diff)
downloadgdm-7db3315e3ccfc79373ca4b032c14fa755f266634.tar.gz
Don't crash on markup parse failure
https://bugzilla.gnome.org/show_bug.cgi?id=619588
Diffstat (limited to 'gui')
-rw-r--r--gui/simple-greeter/gdm-chooser-widget.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gui/simple-greeter/gdm-chooser-widget.c b/gui/simple-greeter/gdm-chooser-widget.c
index 3d10e8ec..180cbcdc 100644
--- a/gui/simple-greeter/gdm-chooser-widget.c
+++ b/gui/simple-greeter/gdm-chooser-widget.c
@@ -1510,8 +1510,6 @@ compare_item (GtkTreeModel *model,
GdmChooserWidget *widget;
char *name_a;
char *name_b;
- char *text_a;
- char *text_b;
gulong prio_a;
gulong prio_b;
gboolean is_separate_a;
@@ -1580,12 +1578,24 @@ compare_item (GtkTreeModel *model,
result *= direction;
} else if (is_separate_b == is_separate_a) {
if (prio_a == prio_b) {
+ char *text_a;
+ char *text_b;
+
+ text_a = NULL;
+ text_b = NULL;
pango_parse_markup (name_a, -1, 0, &attrs, &text_a, NULL, NULL);
+ if (text_a == NULL) {
+ g_debug ("GdmChooserWidget: unable to parse markup: '%s'", name_a);
+ }
pango_parse_markup (name_b, -1, 0, &attrs, &text_b, NULL, NULL);
- if (text_a && text_b)
- result = g_utf8_collate (text_a, text_b);
- else
- result = g_utf8_collate (name_a, name_b);
+ if (text_b == NULL) {
+ g_debug ("GdmChooserWidget: unable to parse markup: '%s'", name_b);
+ }
+ if (text_a != NULL && text_b != NULL) {
+ result = g_utf8_collate (text_a, text_b);
+ } else {
+ result = g_utf8_collate (name_a, name_b);
+ }
g_free (text_a);
g_free (text_b);
} else if (prio_a > prio_b) {