Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 695fc838fdfaf8cc25732c36b2e6fb8dee7799a7
Ticket: 3371644fffffffffffffffffffffffffffffffff
Segfault in Tcl_ConvertElement()
User & Date: ferrieux on 2011-07-20 01:02:12
Changes

  1. icomment:
    Also repro on 8.6 HEAD. There, line 1264 of tclUtil.c has a suspicious "length--" applied to a length of -1.
    
    Patch below fixes it and passes the test suite.
    
    Index: generic/tclUtil.c
    ===================================================================
    --- generic/tclUtil.c
    +++ generic/tclUtil.c
    @@ -1259,11 +1259,11 @@
            if (conversion == CONVERT_ESCAPE) {
                p[0] = '\\';
                p[1] = '#';
                p += 2;
                src++;
    -           length--;
    +           if (length >=0) length--;
            } else {
                conversion = CONVERT_BRACE;
            }
         }
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"