From 964185dec3fed72b094c4641275d6842fcf691d5 Mon Sep 17 00:00:00 2001 From: Mikko Ohtamaa Date: Thu, 18 May 2017 00:38:41 +0300 Subject: [PATCH] Protect transferFrom against short hand attack. --- contracts/token/StandardToken.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/StandardToken.sol b/contracts/token/StandardToken.sol index dcb40053b..865fe1b3c 100644 --- a/contracts/token/StandardToken.sol +++ b/contracts/token/StandardToken.sol @@ -16,7 +16,7 @@ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) allowed; - function transferFrom(address _from, address _to, uint _value) { + function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met