-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
ternal/encryption/encryption.go
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
var seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano()))
https://github.com/apps/copilot-pull-request-reviewer AI
12 minutes ago
The global variable seededRand is not thread-safe. If multiple goroutines call GenerateRandomString concurrently, this can lead to race conditions and data corruption. The rand.Rand type is not safe for concurrent use by multiple goroutines.
Consider using crypto/rand which is thread-safe, or if you must use math/rand, protect access to the shared rand.Rand instance with a mutex.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels