Tcl Source Code

Check-in [b6601d604f]
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:[824752f10e] Avoid calling Tcl_SetObjResult if interp is NULL
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: b6601d604fc8a279ef7e92ecf98c4f7a9d19dcdb
User & Date: gahr 2016-11-04 14:21:04
Context
2016-11-04
14:37
[824752f10e] More robust, portable check for integer overflow. check-in: 9b1cb4c030 user: dgp tags: core-8-5-branch
14:24
merge core-8-5-branch ([824752f10e] Avoid calling Tcl_SetObjResult if interp is NULL) check-in: 16efbc4dbf user: gahr tags: trunk
14:23
merge core-8-5-branch ([824752f10e] Avoid calling Tcl_SetObjResult if interp is NULL) check-in: e7a9d70cd2 user: gahr tags: core-8-6-branch
14:21
[824752f10e] Avoid calling Tcl_SetObjResult if interp is NULL check-in: b6601d604f user: gahr tags: core-8-5-branch
2016-11-02
12:41
Update http version number to 2.7.14, due to [838e99a76d] check-in: 9a63070856 user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tclListObj.c.

851
852
853
854
855
856
857

858
859


860
861
862
863
864
865
866
	 * The 'first+count < 0' condition here guards agains integer
	 * 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 */

    for (i = 0;  i < objc;  i++) {
	Tcl_IncrRefCount(objv[i]);






>
|
|
>
>







851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
	 * The 'first+count < 0' condition here guards agains integer
	 * 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 */

    for (i = 0;  i < objc;  i++) {
	Tcl_IncrRefCount(objv[i]);