Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 90046925fc16b53c94f724e8be056839972b0ca8
Ticket: 218455ffffffffffffffffffffffffffffffffff
Patch for short array in GetPermissionsAttribute
User & Date: nobody on 2000-10-26 01:00:36
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 584 Bug
    Version: 8.1a2
    SubmitDate: '1998-05-21'
    LastModified: '1998-12-08'
    Severity: SER
    Status: Released
    Submitter: hershey
    ChangedBy: stanton
    OS: All
    OSVersion: NA
    Machine: NA
    FixedDate: '1998-12-08'
    FixedInVersion: 8.1b1
    ClosedDate: '2000-10-25'
    
    
    In Tcl8.1a2, the function GetPermissionsAttribute in
    
    unix/tclUnixFCmd.c declares the array returnString to be 6 characters.
    
    It then writes into it using sprintf with a format string of "%0#5lo".
    
    This format string will print at least one `0' because of the #,
    
    followed by up to 5 characters.  This can mean returning a string with
    
    six characters, overflowing the declared size of the array.
    
    
    I have appended the obvious patch.
    
    
    Incidentally, the comment above this function refers to the group
    
    attribute of the file, probably a bad copy from GetGroupAttribute.
    
    
    Ian Taylor
    
    [email protected]
    
    
    *** tclUnixFCmd.c.~1~   Fri Apr 10 17:14:19 1998
    
    --- tclUnixFCmd.c       Fri Apr 10 17:14:37 1998
    
    *************** GetPermissionsAttribute(interp, objIndex
    
    *** 1168,1174 ****
    
          Tcl_Obj **attributePtrPtr;            /* A pointer to return the object with. */
    
      {
    
          struct stat statBuf;
    
    !     char returnString[6];
    
          Tcl_DString ds;
    
          CONST char *native;
    
          int result;
    
    --- 1168,1174 ----
    
          Tcl_Obj **attributePtrPtr;            /* A pointer to return the object with. */
    
      {
    
          struct stat statBuf;
    
    !     char returnString[7];
    
          Tcl_DString ds;
    
          CONST char *native;
    
          int result;
    
    
    
    
    12/08/1998 13:24 - stanton - This patch was applied 11/30/98.
    
  4. foundin changed to: "obsolete: 8.1a2"
  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: "Patch for short array in GetPermissionsAttribute"
  11. type changed to: "Bug"