summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2018-03-24 01:01:25 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2018-03-24 01:01:25 -0700
commitc8fd35e41fbd5e33f0155ac12ec89ac4048ed37e (patch)
tree1a9fe2f0e3a0c6be2a84d432c5e61775c73941db
parent931f07f89512515738ef58577c7df385fec7b7c0 (diff)
Avoid using dead pointer in _XawTextSetSelection
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@oracle.com>
-rw-r--r--src/Text.c2
1 files changed, 1 insertions, 1 deletions
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;
}