Overview
| Artifact ID: | 23d1fa2d14d0cdd3e83c4c13e431e59b0cc4754c |
|---|---|
| Ticket: | 218932ffffffffffffffffffffffffffffffffff
Tcl_Alloc behaviour differ from malloc |
| User & Date: | nobody on 2000-10-26 01:08:06 |
Changes
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
OriginalBugID: 2807 RFE Version: 8.2 SubmitDate: '1999-09-16' LastModified: '1999-11-02' Severity: MED Status: Released Submitter: techsupp ChangedBy: hobbs OS: Digital Unix OSVersion: 4.0e Machine: Other FixedDate: '1999-11-02' FixedInVersion: 8.2.1 ClosedDate: '2000-10-25' Name: Evelino Bomitali CustomShell: Modification to Tcl_Alloc Comments: The patch proposed is based on the assumption that Tcl_Alloc is substantially an enhanced version of malloc. Probably this is a better solution compared with the previous patch proposal. ReproducibleScript: The header of the file tclCkalloc.c claims that it is an interface to malloc that support some checking. However, Tcl_Alloc return an error for request for a zero size memory while malloc return a NULL pointer. ObservedBehavior: During execution of test "scan-3.4" in the standard test suite, a call to ckalloc (and hence Tcl_Alloc) with size equal to zero is made, resulting in a core dump. Patch: The solution I am proposing is to modify Tcl_Alloc such that it return a NULL pointer if the size of memory requested is zero. 800c800,803 < --- > > if (size == 0) { > return NULL; > } 813a817,820 > > if (size == 0) { > return NULL; > } PatchFiles: tclCkalloc.c This has been changed to RFE because the assumption is more of an RFE, as we don't define it this way. This sounds reasonable, so we could target it for 8.3. -- 09/17/1999 hobbs It was decided to add better handling for checking on the NULL case in 8.2.1, which supports both DG-UX, AIX and similar OSes that return NULL for malloc(0). -- 11/02/1999 hobbs - foundin changed to: "obsolete: 8.2"
- 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: "Tcl_Alloc behaviour differ from malloc"
- type changed to: "RFE"