Add zero address check on getNextValidator usage

This commit is contained in:
Gerardo Nardelli 2019-01-08 14:36:52 -03:00
parent 6912fdcad9
commit 212d796412
1 changed files with 5 additions and 1 deletions

View File

@ -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;