Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: dfb26b470425d06435721300b50a178a1d31b2c5
Ticket: 2845535fffffffffffffffffffffffffffffffff
string overflow panic in [format]
User & Date: mistachkin on 2009-08-27 12:38:31
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The following command triggers a crash in 8.4, 8.5, and HEAD:
    
    format "%.2147483647f" 2
    
    The following command triggers a crash in 8.5 and HEAD (in 8.4 it produces some kind of result):
    
    format "%2147483647.f" 2
    
    The following code (near line 2187) in "generic\tclStringObj.c" is a bit problematic due to unchecked usage of sprintf with a fixed size buffer:
    
        char spec[2*TCL_INTEGER_SPACE + 9], *p = spec;
        <snip>
        if (width) {
    p += sprintf(p, "%d", width);
    if (width > length) {
        length = width;
    } 
        }
        if (gotPrecision) {
    *p++ = '.';
    p += sprintf(p, "%d", precision);
    length += precision;
        }
    
    
  4. foundin changed to: "obsolete: 8.6b1.1"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "mistachkin"
  10. subsystem changed to: "16. Commands A-H"
  11. title changed to: "crash issue with [format]"
  12. type changed to: "Bug"