Overview
| Artifact ID: | 90046925fc16b53c94f724e8be056839972b0ca8 |
|---|---|
| Ticket: | 218455ffffffffffffffffffffffffffffffffff
Patch for short array in GetPermissionsAttribute |
| User & Date: | nobody on 2000-10-26 01:00:36 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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.
- foundin changed to: "obsolete: 8.1a2"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "69. Other"
- title changed to: "Patch for short array in GetPermissionsAttribute"
- type changed to: "Bug"