Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 2038282811a73303048f0db068765a3096e3c51a
Ticket: 218918ffffffffffffffffffffffffffffffffff
regsub commands causes core dump
User & Date: nobody on 2000-10-26 01:07:52
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2723 Bug
    Version: 8.2
    SubmitDate: '1999-09-10'
    LastModified: '1999-09-10'
    Severity: CRIT
    Status: Released
    Submitter: techsupp
    ChangedBy: hobbs
    OS: SunOS
    OSVersion: All other platforms are affetced as well
    Machine: Sparc
    FixedDate: '1999-09-10'
    FixedInVersion: 8.2.1
    ClosedDate: '2000-10-25'
    
    
    Name:
    Wolfgang S. Kechel
    
    Comments:
    Error happens only when regsub command is used with wrong replacement
        spec.
    
    ReproducibleScript:
    regsub scene- scene-push {win-\1} winproc
        
        I know this spec is wrong, but it should not cause memory corruption or
        core-dumps.
        The correct command is:
        regsub {scene-(.+)} scene-push {win-\1} winproc;
    
    ObservedBehavior:
    The code in Tcl_RegSubObjCmd line 490, the indexed match 1 is used in
            subStart = info.matches[index].start;
            subEnd = info.matches[index].end;
        for \1 in the substitution spec, but there is not first match. So memory
        is
        dereferenced that should not be referenced and a portion of data is
        appended
        to the result that has nothing to do with the command parameters. It
        happens,
        that due to the values stored in the memory area chunk of 80MB or even
        larger might be copied into the result, the chunks may become to big for
        malloc and
        cause a core dump.
        
        into the result or
    
    DesiredBehavior:
    I expect the regsub command to issue an error when no match for a \Digit
        spec
        is present in the source string (like Emacs does it)!
    
    
    
    I have fixed
    this for the next release to just default to null, which is the same
    behavior that Perl and Emacs have. 
    -- 09/10/1999 hobbs
    
  4. foundin changed to: "obsolete: 8.2"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "69. Other"
  10. title changed to: "regsub commands causes core dump"
  11. type changed to: "Bug"