diff options
author | dgp <dgp@users.sourceforge.net> | 2009-02-02 05:54:53 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-02-02 05:54:53 (GMT) |
commit | 0c355e47e82f42d8d8988dc9eebadb524f1cc772 (patch) | |
tree | 0e0863507d73ca75f95718cb63ab0e4c51ce9690 | |
parent | 5d9f498e2eee76fe8198e5dd7894820ea5ea6922 (diff) | |
download | tcl-0c355e47e82f42d8d8988dc9eebadb524f1cc772.zip tcl-0c355e47e82f42d8d8988dc9eebadb524f1cc772.tar.gz tcl-0c355e47e82f42d8d8988dc9eebadb524f1cc772.tar.bz2 |
* generic/tclStringObj.c (STRING_NOMEM): Add missing cast of
NULL to (char *) that upsets some compilers. [Bug 2494093].
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | generic/tclStringObj.c | 5 |
2 files changed, 6 insertions, 2 deletions
@@ -1,5 +1,8 @@ 2009-02-02 Don Porter <dgp@users.sourceforge.net> + * generic/tclStringObj.c (STRING_NOMEM): Add missing cast of + NULL to (char *) that upsets some compilers. [Bug 2494093]. + * generic/tclStringObj.c (Tcl_(Attempt)SetObjLength): Added protections against callers asking for negative lengths. It is likely when this happens that an integer overflow is to blame. diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index f5ba669..da80876 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -33,7 +33,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStringObj.c,v 1.80 2009/02/02 05:47:54 dgp Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.81 2009/02/02 05:54:53 dgp Exp $ */ #include "tclInt.h" #include "tommath.h" @@ -110,7 +110,8 @@ typedef struct String { #define STRING_SIZE(numBytes) \ (sizeof(String) - sizeof(Tcl_UniChar) + (numBytes)) #define STRING_NOMEM(numBytes) \ - (Tcl_Panic("unable to alloc %u bytes", STRING_SIZE(numBytes)), NULL) + (Tcl_Panic("unable to alloc %u bytes", STRING_SIZE(numBytes)), \ + (char *) NULL) #define stringAlloc(numBytes) \ (String *) (((numBytes) > INT_MAX - STRING_SIZE(0)) \ ? STRING_NOMEM(numBytes) \ |