1 |
lxnay 11/08/02 16:44:29 |
2 |
|
3 |
Added: lxdm-0.4.1-git-fix-null-pointer-deref.patch |
4 |
Log: |
5 |
backport NULL pointer dereference patch from git |
6 |
|
7 |
(Portage version: 2.2.0_alpha37/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/lxde-base/lxdm/files/lxdm-0.4.1-git-fix-null-pointer-deref.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: lxdm-0.4.1-git-fix-null-pointer-deref.patch |
16 |
=================================================================== |
17 |
From 19f82a206b2cec964cea0475395d63dedf183788 Mon Sep 17 00:00:00 2001 |
18 |
From: Andrea Florio <andrea@××××××××.org> |
19 |
Date: Fri, 29 Jul 2011 23:59:32 +0200 |
20 |
Subject: [PATCH] fix null pointer dereference |
21 |
|
22 |
--- |
23 |
src/config.c | 25 ++++++++++--------------- |
24 |
1 files changed, 10 insertions(+), 15 deletions(-) |
25 |
|
26 |
diff --git a/src/config.c b/src/config.c |
27 |
index 3f92f7b..4603ab4 100644 |
28 |
--- a/src/config.c |
29 |
+++ b/src/config.c |
30 |
@@ -125,24 +125,19 @@ static gboolean image_file_valid(const char *filename) |
31 |
static void update_face_image(GtkWidget *w) |
32 |
{ |
33 |
GdkPixbuf *pixbuf; |
34 |
- char *path; |
35 |
- path=g_build_filename(user->pw_dir,".face",NULL); |
36 |
- if(access(path,R_OK)) |
37 |
- { |
38 |
- g_free(path); |
39 |
- if(ui_nobody) |
40 |
- pixbuf=gdk_pixbuf_new_from_file_at_scale(ui_nobody,48,48,FALSE,NULL); |
41 |
- if(!pixbuf) |
42 |
- pixbuf=gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), |
43 |
+ char *path=g_build_filename(user->pw_dir,".face",NULL); |
44 |
+ pixbuf=gdk_pixbuf_new_from_file_at_scale(path,48,48,FALSE,NULL); |
45 |
+ g_free(path); |
46 |
+ if(!pixbuf && ui_nobody) |
47 |
+ pixbuf=gdk_pixbuf_new_from_file_at_scale(ui_nobody,48,48,FALSE,NULL); |
48 |
+ if(!pixbuf) |
49 |
+ pixbuf=gtk_icon_theme_load_icon(gtk_icon_theme_get_default(), |
50 |
"avatar-default", 48,GTK_ICON_LOOKUP_FORCE_SIZE,NULL); |
51 |
- } |
52 |
- else |
53 |
+ if(pixbuf) |
54 |
{ |
55 |
- pixbuf=gdk_pixbuf_new_from_file_at_scale(path,48,48,FALSE,NULL); |
56 |
- g_free(path); |
57 |
+ gtk_image_set_from_pixbuf(GTK_IMAGE(w),pixbuf); |
58 |
+ g_object_unref(pixbuf); |
59 |
} |
60 |
- gtk_image_set_from_pixbuf(GTK_IMAGE(w),pixbuf); |
61 |
- g_object_unref(pixbuf); |
62 |
} |
63 |
|
64 |
static void set_face_file(const char *filename) |
65 |
-- |
66 |
1.7.0.1 |