Language: Go
Label: safe
CWE: CWE-20 \u2014 Improper Input Validation
The product receives input or data, but it does
        not validate or incorrectly validates that the input has the
        properties that are required to process the data safely and
        correctly.

Code:
func (o *OnChainVerifier) filterSignerRemoved(
	ctx context.Context,
	filterer *multisig.MultisigControlFilterer,
	event *types.SignerEvent,
) error {
	iter, err := filterer.FilterSignerRemoved(
		&bind.FilterOpts{
			Start:   event.BlockNumber,
			End:     &event.BlockNumber,
			Context: ctx,
		},
	)
	if err != nil {
		o.log.Error("Couldn't start filtering on signer removed event",
			logging.Error(err))
		return err
	}
	defer iter.Close()

	for iter.Next() {
		if o.log.GetLevel() <= logging.DebugLevel {
			o.log.Debug("found signer removed event on chain",
				logging.String("old-signer", iter.Event.OldSigner.Hex()),
			)
		}

		nonce, _ := big.NewInt(0).SetString(event.Nonce, 10)
		if iter.Event.Raw.BlockNumber == event.BlockNumber &&
			uint64(iter.Event.Raw.Index) == event.LogIndex &&
			iter.Event.OldSigner.Hex() == event.Address &&
			nonce.Cmp(iter.Event.Nonce) == 0 &&
			iter.Event.Raw.TxHash.Hex() == event.TxHash {
			// now we know the event is OK,
			// just need to check for confirmations
			return o.ethConfirmations.Check(event.BlockNumber)
		}
	}

	return ErrNoSignerEventFound
}