Add zero address check on getNextValidator usage
This commit is contained in:
parent
6912fdcad9
commit
212d796412
|
@ -51,7 +51,7 @@ contract BaseBridgeValidators is EternalStorage, Ownable {
|
|||
index = next;
|
||||
next = getNextValidator(index);
|
||||
|
||||
if (next == F_ADDR) {
|
||||
if (next == F_ADDR || next == address(0) ) {
|
||||
revert();
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,10 @@ contract BaseBridgeValidators is EternalStorage, Ownable {
|
|||
list[counter] = nextValidator;
|
||||
nextValidator = getNextValidator(nextValidator);
|
||||
counter++;
|
||||
|
||||
if (nextValidator == address(0) ) {
|
||||
revert();
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
|
|
Loading…
Reference in New Issue