From ee114deb82a8729d8650977f077587a6b586af5d Mon Sep 17 00:00:00 2001 From: tersec Date: Thu, 1 Oct 2020 19:05:22 +0000 Subject: [PATCH] fix #1782 by checking for empty attester index sets (#1786) --- beacon_chain/attestation_aggregation.nim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beacon_chain/attestation_aggregation.nim b/beacon_chain/attestation_aggregation.nim index 7decee497..8e2187a38 100644 --- a/beacon_chain/attestation_aggregation.nim +++ b/beacon_chain/attestation_aggregation.nim @@ -226,6 +226,11 @@ proc validateAttestation*( attesting_indices = get_attesting_indices( epochRef, attestation.data, attestation.aggregation_bits) + if attesting_indices.len == 0: + # an extension of the check_aggregation_count() check + const err_str: cstring = + "validateAttestation: inconsistent aggregation and committee length" + return err((EVRESULT_REJECT, err_str)) doAssert attesting_indices.len == 1, "Per bits check above" let validator_index = toSeq(attesting_indices)[0]