We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 087d22d commit 89964a3Copy full SHA for 89964a3
1 file changed
internal/certificatetransparency/logmetrics.go
@@ -138,7 +138,14 @@ func (m *LogMetrics) GetAllCTIndexes() CTCertIndex {
138
m.mutex.RLock()
139
defer m.mutex.RUnlock()
140
141
- return m.index
+ // make a copy of the index and return it
142
+ // since map is a refrence type
143
+ copyOfIndex := make(map[string]int64)
144
+ for k, v := range m.index {
145
+ copyOfIndex[k] = v
146
+ }
147
+
148
+ return copyOfIndex
149
}
150
151
func (m *LogMetrics) GetCTIndex(url string) int64 {
0 commit comments