summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-lib
diff options
context:
space:
mode:
authorDrew Moseley <drew_moseley@mentor.com>2014-07-27 19:05:57 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-29 09:58:27 +0100
commit062bd810fcd8c3d80689ab404766d20c9251dca6 (patch)
tree1cfadf6f253e2c3a7fd0bdcc4a5bfa3362ddd034 /meta/recipes-graphics/xorg-lib
parent6a7b98993350d0d24eae0058ae26ae19cfdf7c4c (diff)
downloadpoky-062bd810fcd8c3d80689ab404766d20c9251dca6.tar.gz
libx11: Add missing NULL check
Add a check for NULL on dereferencing the xim pointer. Using mplayer with the x11 backend will trigger this and result in a segfault. (From OE-Core rev: f7d8947744d7dd1d08721ef0e707912304722d2b) Signed-off-by: Drew Moseley <drew_moseley@mentor.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/xorg-lib')
-rw-r--r--meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch72
-rw-r--r--meta/recipes-graphics/xorg-lib/libx11_1.6.2.bb1
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch b/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
new file mode 100644
index 0000000000..30686206ab
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
@@ -0,0 +1,72 @@
1From 4d85d5f3bd8afac893738fd88e19d8cb5cf998ff Mon Sep 17 00:00:00 2001
2From: Drew Moseley <drew_moseley@mentor.com>
3Date: Sun, 27 Jul 2014 13:10:07 -0400
4Subject: [PATCH] libX11: Add missing NULL check on im and im->methods
5
6Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=81822]
7
8Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
9---
10 src/xlibi18n/ICWrap.c | 5 +++--
11 1 file changed, 3 insertions(+), 2 deletions(-)
12
13diff -ru libX11-1.6.2-orig/src/xlibi18n/ICWrap.c libX11-1.6.2/src/xlibi18n/ICWrap.c
14--- libX11-1.6.2-orig/src/xlibi18n/ICWrap.c 2014-07-27 13:38:29.586666449 -0400
15+++ libX11-1.6.2/src/xlibi18n/ICWrap.c 2014-07-27 13:41:39.671609030 -0400
16@@ -169,7 +169,7 @@
17 va_list var;
18 int total_count;
19 XIMArg *args;
20- char *ret;
21+ char *ret = NULL;
22
23 /*
24 * so count the stuff dangling here
25@@ -185,7 +185,8 @@
26 _XIMVaToNestedList(var, total_count, &args);
27 va_end(var);
28
29- ret = (*im->methods->set_values) (im, args);
30+ if (im && im->methods)
31+ ret = (*im->methods->set_values) (im, args);
32 if (args) Xfree(args);
33 return ret;
34 }
35@@ -196,7 +197,7 @@
36 va_list var;
37 int total_count;
38 XIMArg *args;
39- char *ret;
40+ char *ret = NULL;
41
42 /*
43 * so count the stuff dangling here
44@@ -212,7 +213,8 @@
45 _XIMVaToNestedList(var, total_count, &args);
46 va_end(var);
47
48- ret = (*im->methods->get_values) (im, args);
49+ if (im && im->methods)
50+ ret = (*im->methods->get_values) (im, args);
51 if (args) Xfree(args);
52 return ret;
53 }
54@@ -228,7 +230,7 @@
55 va_list var;
56 int total_count;
57 XIMArg *args;
58- XIC ic;
59+ XIC ic = NULL;
60
61 /*
62 * so count the stuff dangling here
63@@ -244,7 +246,8 @@
64 _XIMVaToNestedList(var, total_count, &args);
65 va_end(var);
66
67- ic = (XIC) (*im->methods->create_ic) (im, args);
68+ if (im && im->methods)
69+ ic = (XIC) (*im->methods->create_ic) (im, args);
70 if (args) Xfree(args);
71 if (ic) {
72 ic->core.next = im->core.ic_chain;
diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.6.2.bb b/meta/recipes-graphics/xorg-lib/libx11_1.6.2.bb
index 700bc3680f..a7226480c2 100644
--- a/meta/recipes-graphics/xorg-lib/libx11_1.6.2.bb
+++ b/meta/recipes-graphics/xorg-lib/libx11_1.6.2.bb
@@ -5,6 +5,7 @@ BBCLASSEXTEND = "native nativesdk"
5 5
6SRC_URI += "file://disable_tests.patch \ 6SRC_URI += "file://disable_tests.patch \
7 file://nls-always-use-XCOMM-instead-of-for-comments-in-Comp.patch \ 7 file://nls-always-use-XCOMM-instead-of-for-comments-in-Comp.patch \
8 file://libX11-Add-missing-NULL-check.patch \
8 " 9 "
9 10
10SRC_URI[md5sum] = "c35d6ad95b06635a524579e88622fdb5" 11SRC_URI[md5sum] = "c35d6ad95b06635a524579e88622fdb5"