[PATCH libXaw3d] Avoid using dead pointer in _XawTextSetSelection
Alan Coopersmith
alan.coopersmith at oracle.com
Sat Mar 24 08:06:24 UTC 2018
Reported by: https://bugs.freedesktop.org/show_bug.cgi?id=94375
Fix copied from 2D libXaw commit 11c3a104141e1a4946ad949dfb5514df0b66a031
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
src/Text.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Text.c b/src/Text.c
index 4ce9675..82cdef5 100644
--- a/src/Text.c
+++ b/src/Text.c
@@ -2508,7 +2508,7 @@ _XawTextSetSelection(TextWidget ctx, XawTextPosition l, XawTextPosition r,
if (nelems == 1 && !strcmp (list[0], "none"))
return;
if (nelems == 0) {
- String defaultSel = "PRIMARY";
+ static String defaultSel = "PRIMARY";
list = &defaultSel;
nelems = 1;
}
--
2.15.0
More information about the xorg-devel
mailing list