Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a42aad0ce5fc743c8620cf65bbba70922aac7fb4
Ticket: 1557855fffffffffffffffffffffffffffffffff
fcopy doesn't handle large sizes
User & Date: ferrieux on 2008-04-05 06:05:23
Changes

  1. icomment:
    Logged In: YES 
    user_id=496139
    Originator: NO
    
    Half-fixed :-)
    (Truly fixing would imply switching to at least wide ints or even worse... which may hit the performance of the dominant use of -size with a small value (who would do a fcopy of 4G without a progress indicator ?))
    
    It is not true that there is no error handling: a value over 4G will elicit an "integer value too large to represent" error.
    However, there was still the signed-int vs. unsigned-int issue: a value of 3G is silently accepted as negative, *and* negative values were not rejected.
    
    The patch below (tclIOCmd.c) rejects negative values:
    
    case FcopySize:
        if (TclGetIntFromObj(interp, objv[i+1], &toRead) != TCL_OK) {
    return TCL_ERROR;
        }
    +    if (toRead<0) {
    +Tcl_AppendResult(interp, "negative size forbidden",NULL);
    +return TCL_ERROR;
    +    }
        break;
    
    
    
    
  2. login: "ferrieux"
  3. mimetype: "text/plain"
  4. username: "ferrieux"