Add SB Curated (copied from the smartbugs repository).
This commit is contained in:
24
dataset/arithmetic/integer_overflow_1.sol
Normal file
24
dataset/arithmetic/integer_overflow_1.sol
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* @source: https://github.com/trailofbits/not-so-smart-contracts/blob/master/integer_overflow/integer_overflow_1.sol
|
||||
* @author: -
|
||||
* @vulnerable_at_lines: 14
|
||||
*/
|
||||
|
||||
pragma solidity ^0.4.15;
|
||||
|
||||
contract Overflow {
|
||||
uint private sellerBalance=0;
|
||||
|
||||
function add(uint value) returns (bool){
|
||||
// <yes> <report> ARITHMETIC
|
||||
sellerBalance += value; // possible overflow
|
||||
|
||||
// possible auditor assert
|
||||
// assert(sellerBalance >= value);
|
||||
}
|
||||
|
||||
// function safe_add(uint value) returns (bool){
|
||||
// require(value + sellerBalance >= sellerBalance);
|
||||
// sellerBalance += value;
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user