diff options
author | fvogel <fvogelnew1@free.fr> | 2020-07-06 21:12:34 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-07-06 21:12:34 (GMT) |
commit | 16344eac16d280dc9d48bf8acba63e75e3f0c81e (patch) | |
tree | 607e9eaad38bad66a47cb20f7d9fa218bb147ef4 /generic | |
parent | f091ee99d94c754195f5bf41ea4f676d1d34a1d6 (diff) | |
parent | a3aa1937eb168fe1779bfba8ce88b3ef74315630 (diff) | |
download | tk-16344eac16d280dc9d48bf8acba63e75e3f0c81e.zip tk-16344eac16d280dc9d48bf8acba63e75e3f0c81e.tar.gz tk-16344eac16d280dc9d48bf8acba63e75e3f0c81e.tar.bz2 |
Fix [40e4bf6198]: Entry/spinbox: double free when textvariable set in validatecommand script.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkEntry.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tkEntry.c b/generic/tkEntry.c index 5f39b89..906ba43 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -3385,17 +3385,21 @@ EntryValidateChange( if (entryPtr->validateCmd == NULL || entryPtr->validate == VALIDATE_NONE) { + if (entryPtr->flags & VALIDATING) { + entryPtr->flags |= VALIDATE_ABORT; + } return (varValidate ? TCL_ERROR : TCL_OK); } /* - * If we're already validating, then we're hitting a loop condition Return - * and set validate to 0 to disallow further validations and prevent - * current validation from finishing + * If we're already validating, then we're hitting a loop condition. Set + * validate to none to disallow further validations, arrange for flags + * to prevent current validation from finishing, and return. */ if (entryPtr->flags & VALIDATING) { entryPtr->validate = VALIDATE_NONE; + entryPtr->flags |= VALIDATE_ABORT; return (varValidate ? TCL_ERROR : TCL_OK); } |