File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,6 +120,12 @@ abstract contract ProcessorBase is Ownable {
120120 bytes memory errorData;
121121 bool succeeded = true ;
122122
123+ // Check that the number of messages matches the number of functions
124+ // for protection against mismatched inputs
125+ if (nonAtomicSubroutine.functions.length != messages.length ) {
126+ revert ("Number of messages does not match number of functions " );
127+ }
128+
123129 // Execute each function until one fails
124130 for (uint8 i = 0 ; i < nonAtomicSubroutine.functions.length ; i++ ) {
125131 address targetContract = nonAtomicSubroutine.functions[i].contractAddress;
@@ -174,6 +180,12 @@ abstract contract ProcessorBase is Ownable {
174180 revert ProcessorErrors.UnauthorizedAccess ();
175181 }
176182
183+ // Check that the number of messages matches the number of functions
184+ // for protection against mismatched inputs
185+ if (atomicSubroutine.functions.length != messages.length ) {
186+ revert ("Number of messages does not match number of functions " );
187+ }
188+
177189 for (uint8 i = 0 ; i < atomicSubroutine.functions.length ; i++ ) {
178190 address targetContract = atomicSubroutine.functions[i].contractAddress;
179191 // Check contract existence, need to do this check because in EVM
You can’t perform that action at this time.
0 commit comments