Merge pull request #1300 from tendermint/lite-proxy-hardening-and-tests

lite/proxy: Validation* tests and hardening for nil dereferences
This commit is contained in:
Ethan Buchman
2018-04-03 22:43:38 +03:00
committed by GitHub
3 changed files with 230 additions and 1 deletions

View File

@ -176,7 +176,9 @@ type Header struct {
}
// Hash returns the hash of the header.
// Returns nil if ValidatorHash is missing.
// Returns nil if ValidatorHash is missing,
// since a Header is not valid unless there is
// a ValidaotrsHash (corresponding to the validator set).
func (h *Header) Hash() cmn.HexBytes {
if h == nil || len(h.ValidatorsHash) == 0 {
return nil