diff options
author | nijtmans <nijtmans> | 2010-12-06 09:01:49 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-12-06 09:01:49 (GMT) |
commit | 5686ea4acac17705c9704829c24608749acd3d12 (patch) | |
tree | 82897612b5989945d086ccb23f71868fe1a656f6 /generic/tclBinary.c | |
parent | 3a3eeca75b5436a7b68e1464811bdc3528d20cf0 (diff) | |
download | tcl-5686ea4acac17705c9704829c24608749acd3d12.zip tcl-5686ea4acac17705c9704829c24608749acd3d12.tar.gz tcl-5686ea4acac17705c9704829c24608749acd3d12.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) \ |