summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-05-03 19:36:22 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-05-03 19:36:22 (GMT)
commitc44498abe00ae0a220bc301e09fc3ead4275b5e6 (patch)
treefd0d4bb25e72fcbd16be094e52d9ddf02164eb9e /generic
parente0ffb831fb5b4e9f3b3f395c979ec259acb52526 (diff)
downloadtcl-c44498abe00ae0a220bc301e09fc3ead4275b5e6.zip
tcl-c44498abe00ae0a220bc301e09fc3ead4275b5e6.tar.gz
tcl-c44498abe00ae0a220bc301e09fc3ead4275b5e6.tar.bz2
Fix [24b9181478]: Fix unsafe buffer lifetime
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIO.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 4d3df65..807fce1 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -3813,6 +3813,7 @@ Write(
/* State info for channel */
char *nextNewLine = NULL;
int endEncoding, saved = 0, total = 0, flushed = 0, needNlFlush = 0;
+ char safe[BUFFER_PADDING];
if (srcLen) {
WillWrite(chanPtr);
@@ -3831,7 +3832,7 @@ Write(
while (srcLen + saved + endEncoding > 0) {
ChannelBuffer *bufPtr;
- char *dst, safe[BUFFER_PADDING];
+ char *dst;
int result, srcRead, dstLen, dstWrote, srcLimit = srcLen;
if (nextNewLine) {