Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 6cfaf18

Browse files
committed
Fix masker data race
1 parent cbfcae4 commit 6cfaf18

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internals/cli/masker/stream.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,8 @@ func (b *indexedBuffer) upToIndex(index int64) []byte {
120120
}
121121
n := int(index - b.currentIndex)
122122
b.currentIndex = index
123-
return b.buffer.Next(n)
123+
bufferSlice := b.buffer.Next(n)
124+
res := make([]byte, len(bufferSlice))
125+
copy(res, bufferSlice)
126+
return res
124127
}

0 commit comments

Comments
 (0)