diff options
author | dgp <dgp@users.sourceforge.net> | 2011-07-14 02:39:03 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-07-14 02:39:03 (GMT) |
commit | aa1a72b31337d3fa30a90286eac8374c296691be (patch) | |
tree | 4e69e3e808ac000f0961a6a0b43d70583472760d | |
parent | 5f913b056f6f7a725bc34d279386c4888ff7e207 (diff) | |
download | tcl-aa1a72b31337d3fa30a90286eac8374c296691be.zip tcl-aa1a72b31337d3fa30a90286eac8374c296691be.tar.gz tcl-aa1a72b31337d3fa30a90286eac8374c296691be.tar.bz2 |
3366265 Allocate proper size buffer for TclConvertElement() to write to.
-rw-r--r-- | generic/tclIndexObj.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 3e37f0f..7991533 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -541,7 +541,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); @@ -596,7 +597,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); |