n10v / id3v2

🎵 ID3 decoding and encoding library for Go
https://pkg.go.dev/github.com/bogem/id3v2/v2
MIT License
334 stars 50 forks source link

Race condition in UnknownFrame #57

Closed astax-t closed 4 years ago

astax-t commented 4 years ago

UnknownFrame generates unique frame identifier using Rand.Int() method on shared instance of Rand in a variable uidGenerator. But this method is not thread safe.

Go race detector finds this when trying to concurrently create ID3 tags with such frames.

n10v commented 4 years ago

Hi @astax-t! Thank you for submitting the issue. I fixed it in #59