Skip to content

Find, verify, and analyze leaked credentials

Copy buffer bytes (#864)

Bill Richd7d614cc5f64
diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go
index e41db64af..fd2afbc98 100644
--- a/pkg/sources/git/git.go
+++ b/pkg/sources/git/git.go
@@ -406,7 +406,7 @@ func (s *Git) gitChunk(diff gitparse.Diff, fileName, email, hash, when, urlMetad
SourceID: s.sourceID,
SourceType: s.sourceType,
SourceMetadata: metadata,
- Data: newChunkBuffer.Bytes(),
+ Data: append([]byte{}, newChunkBuffer.Bytes()...),
Verify: s.verify,
}
newChunkBuffer.Reset()
@@ -440,7 +440,7 @@ func (s *Git) gitChunk(diff gitparse.Diff, fileName, email, hash, when, urlMetad
SourceID: s.sourceID,
SourceType: s.sourceType,
SourceMetadata: metadata,
- Data: newChunkBuffer.Bytes(),
+ Data: append([]byte{}, newChunkBuffer.Bytes()...),
Verify: s.verify,
}
}