diff options
author | dgp <dgp@noemail.net> | 2014-10-02 14:46:54 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2014-10-02 14:46:54 (GMT) |
commit | 262efc333e39c6b5627f22507d3b5adceabbb2ae (patch) | |
tree | 0614f27e8c09b6f1abe54b91f190bd3c05aaaaaa /generic | |
parent | c7d4062a096a02626a7763ddc62cf106c102d906 (diff) | |
parent | 313a3356228aabe06707e1638f7a84d1f648ebd2 (diff) | |
download | tcl-262efc333e39c6b5627f22507d3b5adceabbb2ae.zip tcl-262efc333e39c6b5627f22507d3b5adceabbb2ae.tar.gz tcl-262efc333e39c6b5627f22507d3b5adceabbb2ae.tar.bz2 |
[bc5b790099] Improper calculation of new dstLimit value. New test io-12.7.
FossilOrigin-Name: 32edfe97223960d0230a28a1a20dac50af0c5cb5
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIO.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c index dcde8d1..aea633c 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -6046,12 +6046,11 @@ ReadChars( /* * We read more chars than allowed. Reset limits to * prevent that and try again. Don't forget the extra - * padding of TCL_UTF_MAX - 1 bytes demanded by the + * padding of TCL_UTF_MAX bytes demanded by the * Tcl_ExternalToUtf() call! */ - dstLimit = Tcl_UtfAtIndex(dst, charsToRead + 1) - + TCL_UTF_MAX - 1 - dst; + dstLimit = Tcl_UtfAtIndex(dst, charsToRead) + TCL_UTF_MAX - dst; statePtr->flags = savedFlags; statePtr->inputEncodingFlags = savedIEFlags; statePtr->inputEncodingState = savedState; |