Tcl Source Code

Check-in [e5a5037389]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:close fork
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e5a503738907cede015b8e6a7cff4b3c2e4fc6b4
User & Date: dgp 2016-11-04 14:42:14
Context
2016-11-04
14:48
[824752f10e] More robust, portable check for integer overflow. check-in: cf3aa0440e user: dgp tags: trunk
14:42
close fork check-in: e5a5037389 user: dgp tags: trunk
14:24
merge core-8-5-branch ([824752f10e] Avoid calling Tcl_SetObjResult if interp is NULL) check-in: 16efbc4dbf user: gahr tags: trunk
11:51
Fix the generated copyright sections in the HTML help file check-in: ec41e853d0 user: jan.nijtmans tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclListObj.c.

903
904
905
906
907
908
909

910
911


912
913
914
915
916
917
918
	 * overflow in determining 'first+count'.
	 */

	count = numElems - first;
    }

    if (objc > LIST_MAX - (numElems - count)) {

	Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		"max length of a Tcl list (%d elements) exceeded", LIST_MAX));


	return TCL_ERROR;
    }
    isShared = (listRepPtr->refCount > 1);
    numRequired = numElems - count + objc; /* Known <= LIST_MAX */
    needGrow = numRequired > listRepPtr->maxElemCount;

    for (i = 0;  i < objc;  i++) {






>
|
|
>
>







903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
	 * overflow in determining 'first+count'.
	 */

	count = numElems - first;
    }

    if (objc > LIST_MAX - (numElems - count)) {
	if (interp != NULL) {
	    Tcl_SetObjResult(interp, Tcl_ObjPrintf(
		    "max length of a Tcl list (%d elements) exceeded",
		    LIST_MAX));
	}
	return TCL_ERROR;
    }
    isShared = (listRepPtr->refCount > 1);
    numRequired = numElems - count + objc; /* Known <= LIST_MAX */
    needGrow = numRequired > listRepPtr->maxElemCount;

    for (i = 0;  i < objc;  i++) {