diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-16 22:28:49 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-16 22:28:49 (GMT) |
commit | 799c4229bbacec663e81638c968ec14cfe8c12d5 (patch) | |
tree | 2a0fb2d10b8942e71fc516ac8bad013ba7e56ae2 | |
parent | 5dff38707576522b97793ce6ad8024b0f92895bb (diff) | |
download | tcl-799c4229bbacec663e81638c968ec14cfe8c12d5.zip tcl-799c4229bbacec663e81638c968ec14cfe8c12d5.tar.gz tcl-799c4229bbacec663e81638c968ec14cfe8c12d5.tar.bz2 |
Fix mostly-harmless minor buffer overrun.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclUtil.c | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +2012-07-16 Donal K. Fellows <dkf@users.sf.net> + + * generic/tclUtil.c (UpdateStringOfEndOffset): [Bug 3544658]: Stop + 1-byte overrun in memcpy, that object placement rules made harmless + but which still caused compiler complaints. + 2012-07-16 Jan Nijtmans <nijtmans@users.sf.net> * library/reg/pkgIndex.tcl: Make registry 1.3 package dynamically diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 3379f6c..63c9fb2 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3426,10 +3426,10 @@ static void UpdateStringOfEndOffset( register Tcl_Obj *objPtr) { - char buffer[TCL_INTEGER_SPACE + sizeof("end") + 1]; + char buffer[TCL_INTEGER_SPACE + 5]; register int len; - memcpy(buffer, "end", sizeof("end") + 1); + memcpy(buffer, "end", 4); len = sizeof("end") - 1; if (objPtr->internalRep.longValue != 0) { buffer[len++] = '-'; |