Skip to content

Commit

Permalink
Fix [24b9181478]: Fix unsafe buffer lifetime
Browse files Browse the repository at this point in the history
  • Loading branch information
jan.nijtmans committed May 3, 2021
1 parent aec24c7 commit 9e3b04a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion generic/tclIO.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down

0 comments on commit 9e3b04a

Please sign in to comment.