Closed
Description
In https://github.com/cosmos/cosmos-sdk/blob/develop/store/types/utils.go#L61
if prefix == nil {
return nil
}
//...
for {
if end[len(end)-1] != byte(255) {
end[len(end)-1]++
break
}
//...
}
In the for loop, we access on the slice without checking the length. When the provided argument has length 0 but not nil([]byte{}
), it throws a runtime error index out of range
. We have to replace the conditional expression to len(prefix) == 0
from the current prefix == nil
.
Activity