summaryrefslogtreecommitdiffstats
path: root/generic
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)
commit545af346b6b7f4d2e3c1bfa931e01202c6c7808d (patch)
tree313f16de04d1f869c193750347eb6047316cb552 /generic
parente06c38d5e7dffdd9153afbd4c7c976de5167ca68 (diff)
downloadtk-545af346b6b7f4d2e3c1bfa931e01202c6c7808d.zip
tk-545af346b6b7f4d2e3c1bfa931e01202c6c7808d.tar.gz
tk-545af346b6b7f4d2e3c1bfa931e01202c6c7808d.tar.bz2
[Bug 2931374]: Stop overflow of working buffer during construction of long
tag expressions.
Diffstat (limited to 'generic')
-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 *)