diff options
| author | nijtmans <nijtmans> | 2010-12-06 09:01:49 (GMT) |
|---|---|---|
| committer | nijtmans <nijtmans> | 2010-12-06 09:01:49 (GMT) |
| commit | 071825786b34486fc7939f704c76291b441844d5 (patch) | |
| tree | 82897612b5989945d086ccb23f71868fe1a656f6 /generic/tclBinary.c | |
| parent | d3bf01bc6e4c6dfc0897c308236ce861b88dc153 (diff) | |
| download | tcl-071825786b34486fc7939f704c76291b441844d5.zip tcl-071825786b34486fc7939f704c76291b441844d5.tar.gz tcl-071825786b34486fc7939f704c76291b441844d5.tar.bz2 | |
[Bug 3129448]: possible over-allocation on 64-bit platforms
Diffstat (limited to 'generic/tclBinary.c')
| -rw-r--r-- | generic/tclBinary.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclBinary.c b/generic/tclBinary.c index b40e109..6036f31 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBinary.c,v 1.67 2010/11/19 10:17:22 nijtmans Exp $ + * RCS: @(#) $Id: tclBinary.c,v 1.68 2010/12/06 09:01:49 nijtmans Exp $ */ #include "tclInt.h" @@ -174,13 +174,13 @@ typedef struct ByteArray { * array. */ int allocated; /* The amount of space actually allocated * minus 1 byte. */ - unsigned char bytes[4]; /* The array of bytes. The actual size of this + unsigned char bytes[1]; /* The array of bytes. The actual size of this * field depends on the 'allocated' field * above. */ } ByteArray; #define BYTEARRAY_SIZE(len) \ - ((unsigned) (sizeof(ByteArray) - 4 + (len))) + ((unsigned) (TclOffset(ByteArray, bytes) + (len))) #define GET_BYTEARRAY(objPtr) \ ((ByteArray *) (objPtr)->internalRep.otherValuePtr) #define SET_BYTEARRAY(objPtr, baPtr) \ |
