mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-08 06:15:33 +00:00
libs/rand: fix "out-of-memory" error on unexpected argument (#5215)
This commit is contained in:
@@ -149,6 +149,10 @@ func (r *Rand) Seed(seed int64) {
|
||||
|
||||
// Str constructs a random alphanumeric string of given length.
|
||||
func (r *Rand) Str(length int) string {
|
||||
if length <= 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
chars := []byte{}
|
||||
MAIN_LOOP:
|
||||
for {
|
||||
|
||||
Reference in New Issue
Block a user