summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvas.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2010-01-19 22:02:41 (GMT)
committerdkf <dkf@noemail.net>2010-01-19 22:02:41 (GMT)
commitfd5b72265103be114ba6ded69791fa7a81ba4c6e (patch)
tree313f16de04d1f869c193750347eb6047316cb552 /generic/tkCanvas.c
parent8f4630c9b77dafae42144f8ebb15a0a570c5a29d (diff)
downloadtk-fd5b72265103be114ba6ded69791fa7a81ba4c6e.zip
tk-fd5b72265103be114ba6ded69791fa7a81ba4c6e.tar.gz
tk-fd5b72265103be114ba6ded69791fa7a81ba4c6e.tar.bz2
[Bug 2931374]: Stop overflow of working buffer during construction of long
tag expressions. FossilOrigin-Name: 4952176bcce51eb1b6ca8addb37b21c12b8ad4f9
Diffstat (limited to 'generic/tkCanvas.c')
-rw-r--r--generic/tkCanvas.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index eed2d5a..fa160b9 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvas.c,v 1.46.2.3 2010/01/18 21:20:09 nijtmans Exp $
+ * RCS: @(#) $Id: tkCanvas.c,v 1.46.2.4 2010/01/19 22:02:43 dkf Exp $
*/
/* #define USE_OLD_TAG_SEARCH 1 */
@@ -3233,7 +3233,11 @@ TagSearchScanExpr(
while (searchPtr->stringIndex < searchPtr->stringLength) {
c = searchPtr->string[searchPtr->stringIndex++];
- if (expr->allocated == expr->index) {
+ /*
+ * Need two slots free at this point, not one. [Bug 2931374]
+ */
+
+ if (expr->index >= expr->allocated-1) {
expr->allocated += 15;
if (expr->uids) {
expr->uids = (Tk_Uid *)