From 19eaac3ba495001c3fecfb2888d2cbe52f76af35 Mon Sep 17 00:00:00 2001 From: Marko Date: Mon, 23 Oct 2023 15:33:48 +0200 Subject: [PATCH] fix(authz): check string is not empty (#18209) --- x/authz/generic_authorization.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/authz/generic_authorization.go b/x/authz/generic_authorization.go index 4256c5fb1a3b..d543a6b282a6 100644 --- a/x/authz/generic_authorization.go +++ b/x/authz/generic_authorization.go @@ -2,6 +2,7 @@ package authz import ( "context" + "errors" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/authz" @@ -26,5 +27,8 @@ func (a GenericAuthorization) Accept(ctx context.Context, msg sdk.Msg) (authz.Ac // ValidateBasic implements Authorization.ValidateBasic. func (a GenericAuthorization) ValidateBasic() error { + if a.Msg == "" { + return errors.New("msg type cannot be empty") + } return nil }