Browse Source

libs/rand: fix "out-of-memory" error on unexpected argument (#5215)

pull/5223/head
Sad Pencil 4 years ago
committed by GitHub
parent
commit
62d09ccc10
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +4
    -0
      libs/rand/random.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -19,3 +19,4 @@ Friendly reminder, we have a [bug bounty program](https://hackerone.com/tendermi
- [evidence] [\#5170](https://github.com/tendermint/tendermint/pull/5170) change abci evidence time to the time the infraction happened not the time the evidence was committed on the block (@cmwaters)
- [node] Don't attempt fast sync when the ABCI application specifies ourself as the only validator via `InitChain` (@erikgrinaker)
- [libs/rand] [\#5215](https://github.com/tendermint/tendermint/pull/5215) Fix out-of-memory error on unexpected argument of Str() (@SadPencil)

+ 4
- 0
libs/rand/random.go View File

@ -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 {


Loading…
Cancel
Save