Add SB Curated (copied from the smartbugs repository).
This commit is contained in:
16
dataset/unchecked_low_level_calls/mishandled.sol
Normal file
16
dataset/unchecked_low_level_calls/mishandled.sol
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* @source: https://github.com/seresistvanandras/EthBench/blob/master/Benchmark/Simple/mishandled.sol
|
||||
* @author: -
|
||||
* @vulnerable_at_lines: 14
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.0;
|
||||
contract SendBack {
|
||||
mapping (address => uint) userBalances;
|
||||
function withdrawBalance() {
|
||||
uint amountToWithdraw = userBalances[msg.sender];
|
||||
userBalances[msg.sender] = 0;
|
||||
// <yes> <report> UNCHECKED_LL_CALLS
|
||||
msg.sender.send(amountToWithdraw);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user