Skip to content
Tcl Source Code History Of Ticket c2d22775ce4c6b53
Login

History Of Ticket c2d22775ce4c6b53

Artifacts Associated With Ticket c2d22775ce4c6b53

  1. Ticket change [427efc96b9] (rid 155231) by anonymous on 2017-08-02 06:35:08:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Tcl_ListObjReplace contains code:
      int first;
      int count
      ....
      if (numElems < first+count || first+count < 0) {
      /*
      * The 'first+count < 0' condition here guards agains integer
      * overflow in determining 'first+count'.
      */
      
      So overflow is expected but it's calculated with signed type which is "undefined behavior"
      
      Proposed fix:
      
      --- old/generic/tclListObj.c	2015-11-17 17:03:00.000000000 -0800
      +++ new/generic/tclListObj.c	2017-08-01 23:22:59.000000000 -0700
      @@ -897,13 +897,16 @@
           }
           if (count < 0) {
       	count = 0;
      -    } else if (numElems < first+count || first+count < 0) {
      -	/*
      -	 * The 'first+count < 0' condition here guards agains integer
      -	 * overflow in determining 'first+count'.
      -	 */
      +    } else {
      +	int firstWithCount = (unsigned) first + count;
      +	if (numElems < firstWithCount || firstWithCount < 0) {
      +	    /*
      +	     * The 'first+count < 0' condition here guards agains integer
      +	     * overflow in determining 'first+count'.
      +	     */
       
      -	count = numElems - first;
      +	    count = numElems - first;
      +	}
           }
       
           isShared = (listRepPtr->refCount > 1);
      
    5. foundin initialized to: "8.6.4"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "61ec11df7062b717a200d064063aa94b7b27781c"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "None"
    15. title initialized to: "Fix signed integer overflow in Tcl_ListObjReplace"
    16. type initialized to: "Patch"
  2. Ticket change [4c4d30c317] (rid 155232) by dgp on 2017-08-02 19:28:10:

    1. closedate changed to: "2457968.31122858"
    2. closer changed to: "dgp"
    3. icomment:
      
      Already fixed for 8.6.7+
      
      https://core.tcl.tk/tcl/info/b2a4266498c8dfd7
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Duplicate"
    7. status changed to: "Closed"