summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authorkjnash <k.j.nash@usa.net>2017-06-13 18:15:46 (GMT)
committerkjnash <k.j.nash@usa.net>2017-06-13 18:15:46 (GMT)
commit0d8755e7bb74882ca10bb7cbde4fb4097cb2cc51 (patch)
tree0783d7c109ac2b5667533b5299d32a80deb45d8c /generic/tkText.c
parentd28664f9b1810d40530b09cdcb91eddede0f298d (diff)
downloadtk-0d8755e7bb74882ca10bb7cbde4fb4097cb2cc51.zip
tk-0d8755e7bb74882ca10bb7cbde4fb4097cb2cc51.tar.gz
tk-0d8755e7bb74882ca10bb7cbde4fb4097cb2cc51.tar.bz2
Test whether in a safe interpreter before writing to the PRIMARY selection. Fixes bug [de156e9efe]. Ready for testing.
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 6ff1db9..b5ba1c4 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -2077,7 +2077,7 @@ ConfigureText(
Tcl_Obj *const objv[]) /* Argument objects. */
{
Tk_SavedOptions savedOptions;
- int oldExport = textPtr->exportSelection;
+ int oldExport = (textPtr->exportSelection) && (!Tcl_IsSafe(textPtr->interp));
int mask = 0;
if (Tk_SetOptions(interp, (char *) textPtr, textPtr->optionTable,
@@ -2306,7 +2306,7 @@ ConfigureText(
* are tagged characters.
*/
- if (textPtr->exportSelection && (!oldExport)) {
+ if (textPtr->exportSelection && (!oldExport) && (!Tcl_IsSafe(textPtr->interp))) {
TkTextSearch search;
TkTextIndex first, last;
@@ -3377,7 +3377,7 @@ TextFetchSelection(
TkTextSearch search;
TkTextSegment *segPtr;
- if (!textPtr->exportSelection) {
+ if ((!textPtr->exportSelection) || Tcl_IsSafe(textPtr->interp)) {
return -1;
}
@@ -3507,7 +3507,7 @@ TkTextLostSelection(
if (TkpAlwaysShowSelection(textPtr->tkwin)) {
TkTextIndex start, end;
- if (!textPtr->exportSelection) {
+ if ((!textPtr->exportSelection) || Tcl_IsSafe(textPtr->interp)) {
return;
}