summaryrefslogtreecommitdiffstats
path: root/generic/tclIndexObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIndexObj.c')
-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);