Possible underflows

This commit is contained in:
Richard Ramos 2018-07-03 10:34:39 -04:00
parent c5201fc0a6
commit fe7c0020e1
1 changed files with 4 additions and 1 deletions

View File

@ -158,6 +158,9 @@ contract PollManager is Controlled {
uint amount = p.votes[msg.sender]; uint amount = p.votes[msg.sender];
if (amount == 0) return; if (amount == 0) return;
assert(p.voters != 0);
assert(amount <= p.results);
p.votes[msg.sender] = 0; p.votes[msg.sender] = 0;
p.voters--; p.voters--;