summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvas.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-01-19 22:02:42 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-01-19 22:02:42 (GMT)
commit1194c72f25a0e42a36978e2ba295809255856e49 (patch)
tree313f16de04d1f869c193750347eb6047316cb552 /generic/tkCanvas.c
parentb0e67bffbe79c9bca945114d5b8df70419afbcd6 (diff)
downloadtk-1194c72f25a0e42a36978e2ba295809255856e49.zip
tk-1194c72f25a0e42a36978e2ba295809255856e49.tar.gz
tk-1194c72f25a0e42a36978e2ba295809255856e49.tar.bz2
[Bug 2931374]: Stop overflow of working buffer during construction of long
tag expressions.
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 *)