diff options
author | dgp <dgp@noemail.net> | 2011-07-14 02:39:03 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2011-07-14 02:39:03 (GMT) |
commit | dc354829331c2b525b2cb5da4c6748780f93a061 (patch) | |
tree | 4e69e3e808ac000f0961a6a0b43d70583472760d | |
parent | 20a009d5cd4ab3c04d0e952a3ed923497e62b168 (diff) | |
download | tcl-dc354829331c2b525b2cb5da4c6748780f93a061.zip tcl-dc354829331c2b525b2cb5da4c6748780f93a061.tar.gz tcl-dc354829331c2b525b2cb5da4c6748780f93a061.tar.bz2 |
3366265 Allocate proper size buffer for TclConvertElement() to write to.
FossilOrigin-Name: edfd80bc20b9eddc9d117c7c81aceda7cc5ea01a
-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); |