Artifacts Associated With Ticket 218196ffffffffff
Ticket change [86d5c0d87b] (rid 131585) by nobody on 2000-10-26 00:54:23:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2384 Bug Version: 8.2b1 SubmitDate: '1999-07-19' LastModified: '1999-07-21' Severity: SER Status: Closed Submitter: techsupp ChangedBy: redman OS: Other Machine: NA FixedDate: '2000-10-25' ClosedDate: '1999-07-21' Name: Martin Forssen ObservedBehavior: Tcl_DbCkrealloc crashes if the memory area to be realloced is NULL. DesiredBehavior: It should work as Tcl_Dballoc in this case (since that is what realloc does) Patch: *** generic/tclCkalloc.c Fri Apr 16 03:46:42 1999 --- ../tcl8.1/generic/tclCkalloc.c Fri May 7 22:27:39 1999 *************** *** 522,535 **** { char *new; unsigned int copySize; /* * See comment from Tcl_DbCkfree before you change the following * line. */ ! struct mem_header *memp = (struct mem_header *) ! (((unsigned long) ptr) - BODY_OFFSET); copySize = size; if (copySize > (unsigned int) memp->length) { --- 522,539 ---- { char *new; unsigned int copySize; + struct mem_header *memp; + + if (NULL == ptr) { + return Tcl_DbCkalloc(size, file, line); + } /* * See comment from Tcl_DbCkfree before you change the following * line. */ ! memp = (struct mem_header *) (((unsigned long) ptr) - BODY_OFFSET); copySize = size; if (copySize > (unsigned int) memp->length) { PatchFiles: generic/tclCkalloc.c Umm... why in the world would you realloc a NULL pointer? Correct behavior. -- 07/21/1999 redman - foundin initialized to: "obsolete: 8.2b1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "Tcl_DbCkrealloc craches on NULL-pointers"
- type initialized to: "Bug"
Ticket change [da153a4ad3] (rid 107713) by welch on 2000-10-26 08:16:56:
- closedate changed to: "2000-10-26T01:16:56"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [0ea109a821] (rid 94651) by dgp on 2001-04-18 21:36:04:
- closedate changed to: "2001-04-18T14:36:04"
- closer changed to: "dgp"
- subsystem changed to: "41. Memory Allocation"