From c8fd35e41fbd5e33f0155ac12ec89ac4048ed37e Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 24 Mar 2018 01:01:25 -0700 Subject: 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 --- 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; } -- cgit v1.2.3