Skip to content

Commit

Permalink
remove unnecessary empty lines in PathToLeaf.String() (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikgrinaker authored Dec 14, 2020
1 parent b3b6e2a commit c140037
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

- [\#347](https://github.com/cosmos/iavl/pull/347) Fix another integer overflow in `decodeBytes()` that can cause panics for certain inputs. The `ValueOp` and `AbsenceOp` proof decoders are vulnerable to this via malicious inputs since 0.15.0.

- [\#349](https://github.com/cosmos/iavl/pull/349) Fix spurious blank lines in `PathToLeaf.String()`.

## 0.15.1 (December 13, 2020)

### Bug Fixes
Expand Down
6 changes: 3 additions & 3 deletions proof_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func (pl PathToLeaf) stringIndented(indent string) string {
if len(pl) == 0 {
return "empty-PathToLeaf"
}
strs := make([]string, len(pl))
strs := make([]string, 0, len(pl))
for i, pin := range pl {
if i == 20 {
strs[i] = fmt.Sprintf("... (%v total)", len(pl))
strs = append(strs, fmt.Sprintf("... (%v total)", len(pl)))
break
}
strs[i] = fmt.Sprintf("%v:%v", i, pin.stringIndented(indent+" "))
strs = append(strs, fmt.Sprintf("%v:%v", i, pin.stringIndented(indent+" ")))
}
return fmt.Sprintf(`PathToLeaf{
%s %v
Expand Down

0 comments on commit c140037

Please sign in to comment.