Browse Source

Merge pull request #221 from TokenMarketNet/feat/transfer-from-mitigation

Protect transferFrom() against short hand attack.
Manuel Aráoz 8 years ago
parent
commit
ecbfcbb302
1 changed files with 1 additions and 1 deletions
  1. 1 1
      contracts/token/StandardToken.sol

+ 1 - 1
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