Language: Go
Label: vulnerable
CWE: CWE-1284 \u2014 Improper Validation of Specified Quantity in Input
The product receives input that is expected to specify a quantity (such as size or length), but it does not validate or incorrectly validates that the quantity has the required properties.

Code:
func BenchmarkBytes(t *testing.B) {
	bfa := NewBitfield(211)
	bfb := NewBitfield(211)
	for j := 0; j*4 < 211; j++ {
		bfa.SetBit(j * 4)
	}
	t.ResetTimer()
	for i := 0; i < t.N; i++ {
		bfb.SetBytes(bfa.Bytes())
	}
}