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)
commitada3e21ac86baba934efd6d7a2427855079c72ad (patch)
tree82897612b5989945d086ccb23f71868fe1a656f6 /generic/tclBinary.c
parent5beae862e19a2e7436529dc895052bc0b4364ad4 (diff)
downloadtcl-ada3e21ac86baba934efd6d7a2427855079c72ad.zip
tcl-ada3e21ac86baba934efd6d7a2427855079c72ad.tar.gz
tcl-ada3e21ac86baba934efd6d7a2427855079c72ad.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) \