Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 56e9c0dfea01b716c94d7e13d9dd942f2f28e6a0
Ticket: 1267380fffffffffffffffffffffffffffffffff
UpdateStringOfList: overflow detection
User & Date: dgp on 2005-08-23 19:17:24
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    % set x [string repeat a 65536]; concat
    % set y [lrepeat 65536 $x]; concat
    % string length $y
    Segmentation fault
    
    The string rep of $y would need
    a buffer of 4295032831 bytes, but
    that exceeds INT_MAX.
    
    When the scanner (over-)estimates
    the buffer size, it tries to count up
    the need for 4295163905 bytes, but
    the calculation overflows, wraps around
    and it concludes the need for only
    196609 bytes.  This gets allocated easily,
    and we happily start writing to this
    way too short buffer until we march off
    into segfaulting .
    
    Would be better for the scanner to
    detect the overflow (any negative length
    should be the indicator) and Tcl_Panic, 
    I think.
    
  4. foundin changed to: "obsolete: 8.5a4"
  5. priority changed to: "9 Immediate"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "14. List Object"
  10. title changed to: "UpdateStringOfList: overflow detection"
  11. type changed to: "Bug"