From 0a191c1bf565fc5ca0bd0f4302e750b00df8de25 Mon Sep 17 00:00:00 2001 From: rickyyangz Date: Sat, 9 Mar 2019 13:29:21 +0800 Subject: [PATCH] check length of signer addresses --- common/tx/ante.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/tx/ante.go b/common/tx/ante.go index 9decc94d7..db1d35930 100644 --- a/common/tx/ante.go +++ b/common/tx/ante.go @@ -205,9 +205,15 @@ func validateBasic(tx auth.StdTx) (err sdk.Error) { } // Assert that number of signatures is correct. - if signerAddrs := tx.GetSigners(); len(sigs) != len(signerAddrs) { + signerAddrs := tx.GetSigners() + if len(sigs) != len(signerAddrs) { return sdk.ErrUnauthorized("wrong number of signers") } + for _, signerAddr := range signerAddrs { + if len(signerAddr) != sdk.AddrLen { + return sdk.ErrInvalidAddress("contains invalid signer address") + } + } if data := tx.GetData(); len(data) > 0 { return sdk.ErrUnauthorized("data field is not allowed to use in transaction for now")