summaryrefslogtreecommitdiff
path: root/lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch
diff options
context:
space:
mode:
authorBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:24:26 +0200
committerBlackNoxis <steven.darklight@gmail.com>2014-02-15 23:24:26 +0200
commit7224c1253228e5c29c78cb3f0f26ce34770f2356 (patch)
tree1684924656132935256e034f35f92abee6623265 /lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch
Added ebuilds for kogaion desktop
Diffstat (limited to 'lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch')
-rw-r--r--lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch b/lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch
new file mode 100644
index 00000000..7abdbd47
--- /dev/null
+++ b/lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch
@@ -0,0 +1,51 @@
+From 19f82a206b2cec964cea0475395d63dedf183788 Mon Sep 17 00:00:00 2001
+From: Andrea Florio <andrea@opensuse.org>
+Date: Fri, 29 Jul 2011 23:59:32 +0200
+Subject: [PATCH] fix null pointer dereference
+
+---
+ src/config.c | 25 ++++++++++---------------
+ 1 files changed, 10 insertions(+), 15 deletions(-)
+
+diff --git a/src/config.c b/src/config.c
+index 3f92f7b..4603ab4 100644
+--- a/src/config.c
++++ b/src/config.c
+@@ -125,24 +125,19 @@ static gboolean image_file_valid(const char *filename)
+ static void update_face_image(GtkWidget *w)
+ {
+ GdkPixbuf *pixbuf;
+- char *path;
+- path=g_build_filename(user->pw_dir,".face",NULL);
+- if(access(path,R_OK))
+- {
+- g_free(path);
+- if(ui_nobody)
+- pixbuf=gdk_pixbuf_new_from_file_at_scale(ui_nobody,48,48,FALSE,NULL);
+- if(!pixbuf)
+- pixbuf=gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
++ char *path=g_build_filename(user->pw_dir,".face",NULL);
++ pixbuf=gdk_pixbuf_new_from_file_at_scale(path,48,48,FALSE,NULL);
++ g_free(path);
++ if(!pixbuf && ui_nobody)
++ pixbuf=gdk_pixbuf_new_from_file_at_scale(ui_nobody,48,48,FALSE,NULL);
++ if(!pixbuf)
++ pixbuf=gtk_icon_theme_load_icon(gtk_icon_theme_get_default(),
+ "avatar-default", 48,GTK_ICON_LOOKUP_FORCE_SIZE,NULL);
+- }
+- else
++ if(pixbuf)
+ {
+- pixbuf=gdk_pixbuf_new_from_file_at_scale(path,48,48,FALSE,NULL);
+- g_free(path);
++ gtk_image_set_from_pixbuf(GTK_IMAGE(w),pixbuf);
++ g_object_unref(pixbuf);
+ }
+- gtk_image_set_from_pixbuf(GTK_IMAGE(w),pixbuf);
+- g_object_unref(pixbuf);
+ }
+
+ static void set_face_file(const char *filename)
+--
+1.7.0.1
+