Tcl Source Code

Check-in [f43b43900f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for when growth is needed.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: f43b43900f4be34683d6def882e6b973e552db27
User & Date: dgp 2012-02-09 15:00:46
Context
2012-02-10
15:06
Document, by a retroactive bug report, a nasty Notifier issue on 64-bits x86 that affects the 8.4 br... check-in: 1bad99fa02 user: ferrieux tags: core-8-5-branch
2012-02-09
18:38
Testing speedup of TclScanElement(). check-in: c649888cfe user: dgp tags: dgp-scan-element
15:23
Converted the memcpy() calls in append operations to memmove() calls. This adds safety in the case o... check-in: 3bb4751c4e user: dgp tags: trunk
15:00
3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for w... check-in: f43b43900f user: dgp tags: core-8-5-branch
14:57
3484402 Correct Off-By-One error appending unicode. Thanks to Poor Yorick. Also corrected test for w... check-in: f57b5ba48d user: dgp tags: core-8-4-branch
2012-02-06
18:54
3485022 Disable ensemble subcommand compile inside a Tcl_Create*Trace(). check-in: a7cd8eab0f user: dgp tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.







1
2
3
4
5
6
7






2012-02-06  Don Porter  <[email protected]>

	* generic/tclCompCmds.c: [Bug 3485022] TclCompileEnsemble() avoid
	* tests/trace.test:	compile when exec traces set.

2012-02-06  Miguel Sofer  <[email protected]>

>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2012-02-09  Don Porter  <[email protected]>

	* generic/tclStringObj.c:	[Bug 3484402] Correct Off-By-One
	error appending unicode. Thanks to Poor Yorick. Also corrected test
	for when growth is needed. 

2012-02-06  Don Porter  <[email protected]>

	* generic/tclCompCmds.c: [Bug 3485022] TclCompileEnsemble() avoid
	* tests/trace.test:	compile when exec traces set.

2012-02-06  Miguel Sofer  <[email protected]>

Changes to generic/tclStringObj.c.

1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
     * "TCL STRING GROWTH ALGORITHM" comment at the top of this file for an
     * explanation of this growth algorithm.
     */

    numChars = stringPtr->numChars + appendNumChars;
    stringCheckLimits(numChars);

    if (STRING_UALLOC(numChars) >= stringPtr->uallocated) {
	/*
	 * Protect against case where unicode points into the existing
	 * stringPtr->unicode array.  Force it to follow any relocations
	 * due to the reallocs below.
	 */
	int offset = -1;
	if (unicode >= stringPtr->unicode && unicode <= stringPtr->unicode 
		+ 1 + stringPtr->uallocated / sizeof(Tcl_UniChar)) {
	    offset = unicode - stringPtr->unicode;
	}
	
	GrowUnicodeBuffer(objPtr, numChars);
	stringPtr = GET_STRING(objPtr);

	/* Relocate unicode if needed; see above. */







|







|







1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
     * "TCL STRING GROWTH ALGORITHM" comment at the top of this file for an
     * explanation of this growth algorithm.
     */

    numChars = stringPtr->numChars + appendNumChars;
    stringCheckLimits(numChars);

    if (STRING_UALLOC(numChars) > stringPtr->uallocated) {
	/*
	 * Protect against case where unicode points into the existing
	 * stringPtr->unicode array.  Force it to follow any relocations
	 * due to the reallocs below.
	 */
	int offset = -1;
	if (unicode >= stringPtr->unicode && unicode <= stringPtr->unicode 
		+ stringPtr->uallocated / sizeof(Tcl_UniChar)) {
	    offset = unicode - stringPtr->unicode;
	}
	
	GrowUnicodeBuffer(objPtr, numChars);
	stringPtr = GET_STRING(objPtr);

	/* Relocate unicode if needed; see above. */