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 | 08b97e3f0d1b5a3d5000861c827e6ade5e4eda2f (patch) | |
tree | 4e69e3e808ac000f0961a6a0b43d70583472760d /generic/tclIndexObj.c | |
parent | d4163eb057f96c8a20d8304b1c24ed2c39f2c308 (diff) | |
download | tcl-08b97e3f0d1b5a3d5000861c827e6ade5e4eda2f.zip tcl-08b97e3f0d1b5a3d5000861c827e6ade5e4eda2f.tar.gz tcl-08b97e3f0d1b5a3d5000861c827e6ade5e4eda2f.tar.bz2 |
3366265 Allocate proper size buffer for TclConvertElement() to write to.
Diffstat (limited to 'generic/tclIndexObj.c')
-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); |