summaryrefslogtreecommitdiffstats
path: root/generic/tclBinary.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-12-06 09:01:49 (GMT)
committernijtmans <nijtmans>2010-12-06 09:01:49 (GMT)
commit5686ea4acac17705c9704829c24608749acd3d12 (patch)
tree82897612b5989945d086ccb23f71868fe1a656f6 /generic/tclBinary.c
parent3a3eeca75b5436a7b68e1464811bdc3528d20cf0 (diff)
downloadtcl-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.c6
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) \