From b86afd8d0bfe8bf9103587d159c8f36378a2400a Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Tue, 26 Feb 2019 14:54:47 +0100 Subject: [PATCH] Merge PR #3745: Return on zero-length byte array input --- PENDING.md | 1 + store/types/utils.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/PENDING.md b/PENDING.md index 6c1073f2fb..712f9d72a8 100644 --- a/PENDING.md +++ b/PENDING.md @@ -86,6 +86,7 @@ CLI flag. ### SDK +* \#3727 Return on zero-length (including []byte{}) PrefixEndBytes() calls * \#3559 fix occasional failing due to non-determinism in lcd test TestBonding where validator is unexpectedly slashed throwing off test calculations * [\#3411] Include the `RequestInitChain.Time` in the block header init during diff --git a/store/types/utils.go b/store/types/utils.go index a86efdb8c8..20e7d26032 100644 --- a/store/types/utils.go +++ b/store/types/utils.go @@ -58,7 +58,7 @@ func DiffKVStores(a KVStore, b KVStore, prefixesToSkip [][]byte) (kvA cmn.KVPair // range query for all []byte with a certain prefix // Deals with last byte of prefix being FF without overflowing func PrefixEndBytes(prefix []byte) []byte { - if prefix == nil { + if len(prefix) == 0 { return nil }