diff --git a/mythril/analysis/modules/integer.py b/mythril/analysis/modules/integer.py index 8c14b225..e21dbb58 100644 --- a/mythril/analysis/modules/integer.py +++ b/mythril/analysis/modules/integer.py @@ -83,9 +83,9 @@ def _check_integer_overflow(statespace, state, node): if not _verify_integer_overflow(statespace, node, expr, state, model, constraint, op0, op1): return issues - + # Build issue - issue = Issue(node.contract_name, node.function_name, instruction['address'], "Integer Overflow ", "Warning") + issue = Issue(node.contract_name, node.function_name, instruction['address'], "Integer Overflow", "Warning") issue.description = "A possible integer overflow exists in the function `{}`.\n" \ "The addition or multiplication may result in a value higher than the maximum representable integer.".format( diff --git a/tests/testdata/outputs_expected/ether_send.sol.json b/tests/testdata/outputs_expected/ether_send.sol.json index 2c89e2e2..08a5012c 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.json +++ b/tests/testdata/outputs_expected/ether_send.sol.json @@ -14,7 +14,7 @@ "code": "msg.sender.transfer(this.balance)" }, { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `invest()`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "invest()", "type": "Warning", @@ -25,4 +25,4 @@ "code": "balances[msg.sender] += msg.value" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.json b/tests/testdata/outputs_expected/ether_send.sol.o.json index 701f0535..6d6caad0 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.json +++ b/tests/testdata/outputs_expected/ether_send.sol.o.json @@ -11,7 +11,7 @@ "debug": "" }, { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `invest()`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "invest()", "type": "Warning", @@ -19,4 +19,4 @@ "debug": "" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.markdown b/tests/testdata/outputs_expected/ether_send.sol.o.markdown index 6f4b46be..e5a3f7cd 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.markdown +++ b/tests/testdata/outputs_expected/ether_send.sol.o.markdown @@ -13,7 +13,7 @@ In the function `withdrawfunds()` a non-zero amount of Ether is sent to msg.send There is a check on storage index 1. This storage slot can be written to by calling the function `crowdfunding()`. -## Integer Overflow +## Integer Overflow - Type: Warning - Contract: Unknown diff --git a/tests/testdata/outputs_expected/ether_send.sol.o.text b/tests/testdata/outputs_expected/ether_send.sol.o.text index bba084fa..d6d548c7 100644 --- a/tests/testdata/outputs_expected/ether_send.sol.o.text +++ b/tests/testdata/outputs_expected/ether_send.sol.o.text @@ -8,7 +8,7 @@ In the function `withdrawfunds()` a non-zero amount of Ether is sent to msg.send There is a check on storage index 1. This storage slot can be written to by calling the function `crowdfunding()`. -------------------- -==== Integer Overflow ==== +==== Integer Overflow ==== Type: Warning Contract: Unknown Function name: invest() diff --git a/tests/testdata/outputs_expected/metacoin.sol.o.json b/tests/testdata/outputs_expected/metacoin.sol.o.json index 1977ed30..fd59d519 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.o.json +++ b/tests/testdata/outputs_expected/metacoin.sol.o.json @@ -3,7 +3,7 @@ "error": null, "issues": [ { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `sendToken(address,uint256)`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "sendToken(address,uint256)", "type": "Warning", @@ -11,4 +11,4 @@ "debug": "" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/metacoin.sol.o.markdown b/tests/testdata/outputs_expected/metacoin.sol.o.markdown index 6c38d51d..e2495d49 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.o.markdown +++ b/tests/testdata/outputs_expected/metacoin.sol.o.markdown @@ -1,6 +1,6 @@ # Analysis results for test-filename.sol -## Integer Overflow +## Integer Overflow - Type: Warning - Contract: Unknown diff --git a/tests/testdata/outputs_expected/metacoin.sol.o.text b/tests/testdata/outputs_expected/metacoin.sol.o.text index 9cb0bc12..69fbc811 100644 --- a/tests/testdata/outputs_expected/metacoin.sol.o.text +++ b/tests/testdata/outputs_expected/metacoin.sol.o.text @@ -1,4 +1,4 @@ -==== Integer Overflow ==== +==== Integer Overflow ==== Type: Warning Contract: Unknown Function name: sendToken(address,uint256) diff --git a/tests/testdata/outputs_expected/overflow.sol.json b/tests/testdata/outputs_expected/overflow.sol.json index 0c7c0faf..92a56005 100644 --- a/tests/testdata/outputs_expected/overflow.sol.json +++ b/tests/testdata/outputs_expected/overflow.sol.json @@ -14,7 +14,7 @@ "code": "balances[msg.sender] -= _value" }, { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `sendeth(address,uint256)`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "sendeth(address,uint256)", "type": "Warning", @@ -36,4 +36,4 @@ "code": "balances[msg.sender] - _value" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/overflow.sol.markdown b/tests/testdata/outputs_expected/overflow.sol.markdown index 840bbbfc..d6d4a49c 100644 --- a/tests/testdata/outputs_expected/overflow.sol.markdown +++ b/tests/testdata/outputs_expected/overflow.sol.markdown @@ -17,7 +17,7 @@ In */inputs/overflow.sol:12* balances[msg.sender] -= _value ``` -## Integer Overflow +## Integer Overflow - Type: Warning - Contract: Over diff --git a/tests/testdata/outputs_expected/overflow.sol.o.json b/tests/testdata/outputs_expected/overflow.sol.o.json index d9e1b0b8..8345944e 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.json +++ b/tests/testdata/outputs_expected/overflow.sol.o.json @@ -11,7 +11,7 @@ "debug": "" }, { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `sendeth(address,uint256)`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "sendeth(address,uint256)", "type": "Warning", @@ -27,4 +27,4 @@ "debug": "" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/overflow.sol.o.markdown b/tests/testdata/outputs_expected/overflow.sol.o.markdown index 07d375b8..8baede40 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.markdown +++ b/tests/testdata/outputs_expected/overflow.sol.o.markdown @@ -24,7 +24,7 @@ The subtraction may result in a value < 0. A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -## Integer Overflow +## Integer Overflow - Type: Warning - Contract: Unknown diff --git a/tests/testdata/outputs_expected/overflow.sol.o.text b/tests/testdata/outputs_expected/overflow.sol.o.text index f15d633f..bd2a4c99 100644 --- a/tests/testdata/outputs_expected/overflow.sol.o.text +++ b/tests/testdata/outputs_expected/overflow.sol.o.text @@ -16,7 +16,7 @@ A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -------------------- -==== Integer Overflow ==== +==== Integer Overflow ==== Type: Warning Contract: Unknown Function name: sendeth(address,uint256) diff --git a/tests/testdata/outputs_expected/overflow.sol.text b/tests/testdata/outputs_expected/overflow.sol.text index 5dec25ed..64b072ca 100644 --- a/tests/testdata/outputs_expected/overflow.sol.text +++ b/tests/testdata/outputs_expected/overflow.sol.text @@ -12,7 +12,7 @@ balances[msg.sender] -= _value -------------------- -==== Integer Overflow ==== +==== Integer Overflow ==== Type: Warning Contract: Over Function name: sendeth(address,uint256) diff --git a/tests/testdata/outputs_expected/underflow.sol.json b/tests/testdata/outputs_expected/underflow.sol.json index 290dfe4e..3a2fbd91 100644 --- a/tests/testdata/outputs_expected/underflow.sol.json +++ b/tests/testdata/outputs_expected/underflow.sol.json @@ -14,7 +14,7 @@ "code": "balances[msg.sender] -= _value" }, { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `sendeth(address,uint256)`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "sendeth(address,uint256)", "type": "Warning", @@ -36,4 +36,4 @@ "code": "balances[msg.sender] - _value" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/underflow.sol.markdown b/tests/testdata/outputs_expected/underflow.sol.markdown index ca8a6b17..b41efee7 100644 --- a/tests/testdata/outputs_expected/underflow.sol.markdown +++ b/tests/testdata/outputs_expected/underflow.sol.markdown @@ -17,7 +17,7 @@ In */inputs/underflow.sol:12* balances[msg.sender] -= _value ``` -## Integer Overflow +## Integer Overflow - Type: Warning - Contract: Under diff --git a/tests/testdata/outputs_expected/underflow.sol.o.json b/tests/testdata/outputs_expected/underflow.sol.o.json index d9e1b0b8..8345944e 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.json +++ b/tests/testdata/outputs_expected/underflow.sol.o.json @@ -11,7 +11,7 @@ "debug": "" }, { - "title": "Integer Overflow ", + "title": "Integer Overflow", "description": "A possible integer overflow exists in the function `sendeth(address,uint256)`.\nThe addition or multiplication may result in a value higher than the maximum representable integer.", "function": "sendeth(address,uint256)", "type": "Warning", @@ -27,4 +27,4 @@ "debug": "" } ] -} \ No newline at end of file +} diff --git a/tests/testdata/outputs_expected/underflow.sol.o.markdown b/tests/testdata/outputs_expected/underflow.sol.o.markdown index 07d375b8..8baede40 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.markdown +++ b/tests/testdata/outputs_expected/underflow.sol.o.markdown @@ -24,7 +24,7 @@ The subtraction may result in a value < 0. A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -## Integer Overflow +## Integer Overflow - Type: Warning - Contract: Unknown diff --git a/tests/testdata/outputs_expected/underflow.sol.o.text b/tests/testdata/outputs_expected/underflow.sol.o.text index f15d633f..bd2a4c99 100644 --- a/tests/testdata/outputs_expected/underflow.sol.o.text +++ b/tests/testdata/outputs_expected/underflow.sol.o.text @@ -16,7 +16,7 @@ A possible integer underflow exists in the function `sendeth(address,uint256)`. The subtraction may result in a value < 0. -------------------- -==== Integer Overflow ==== +==== Integer Overflow ==== Type: Warning Contract: Unknown Function name: sendeth(address,uint256) diff --git a/tests/testdata/outputs_expected/underflow.sol.text b/tests/testdata/outputs_expected/underflow.sol.text index d44e5608..a3409ad1 100644 --- a/tests/testdata/outputs_expected/underflow.sol.text +++ b/tests/testdata/outputs_expected/underflow.sol.text @@ -12,7 +12,7 @@ balances[msg.sender] -= _value -------------------- -==== Integer Overflow ==== +==== Integer Overflow ==== Type: Warning Contract: Under Function name: sendeth(address,uint256)