Skip to content

Commit 69fb6a1

Browse files
MozirDmitriyivokub
andauthored
fix: panic on zero-length inputs in Mux (#1600)
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
1 parent 0124c2b commit 69fb6a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

std/selector/multiplexer.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ func Map(api frontend.API, queryKey frontend.Variable,
5656
// inputs, otherwise the proof will fail.
5757
func Mux(api frontend.API, sel frontend.Variable, inputs ...frontend.Variable) frontend.Variable {
5858
n := uint(len(inputs))
59+
if n == 0 {
60+
panic("invalid input length 0 for mux")
61+
}
5962
if n == 1 {
6063
api.AssertIsEqual(sel, 0)
6164
return inputs[0]

0 commit comments

Comments
 (0)