summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch')
-rw-r--r--meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch72
1 files changed, 72 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;