summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-07-14 03:19:31 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-07-14 03:19:31 (GMT)
commit3cf6b18da0609dee847149b261634a77b34f502e (patch)
tree8f24f27b6d653067271e863581cc67ed6dd18f94 /generic
parent02ef1632d034f070d79c64264efa65fce9fc5af7 (diff)
parentaa1a72b31337d3fa30a90286eac8374c296691be (diff)
downloadtcl-3cf6b18da0609dee847149b261634a77b34f502e.zip
tcl-3cf6b18da0609dee847149b261634a77b34f502e.tar.gz
tcl-3cf6b18da0609dee847149b261634a77b34f502e.tar.bz2
3366265 Allocate proper size buffer for TclConvertElement() to write to.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIndexObj.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c
index 5b367d6..76c2dea 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -954,7 +954,8 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp, (unsigned)len);
+ char *quotedElementStr = TclStackAlloc(interp,
+ (unsigned)len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);
@@ -1009,7 +1010,8 @@ Tcl_WrongNumArgs(
len = TclScanElement(elementStr, elemLen, &flags);
if (MAY_QUOTE_WORD && len != elemLen) {
- char *quotedElementStr = TclStackAlloc(interp,(unsigned) len);
+ char *quotedElementStr = TclStackAlloc(interp,
+ (unsigned) len + 1);
len = TclConvertElement(elementStr, elemLen,
quotedElementStr, flags);