Skip to content

Commit

Permalink
Update SWC definition [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
thec00n committed Oct 29, 2018
1 parent 1a5cc1d commit 18c484f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions export/swc-definition.json
Expand Up @@ -252,10 +252,10 @@
}
},
"SWC-129": {
"markdown": "# Title\nTypographical Error\n\n## Relationships\n[CWE-597: Use of Wrong Operator in String Comparison](https://cwe.mitre.org/data/definitions/480.html)\n\n## Description\nA typographical error can occur for example when the intent of a defined operation is to sum a number to a variable (+=) but it has accidentally been defined in a wrong way (=+), introducing a typo which happens to be a valid operator. Instead of calculating the sum it initializes the variable again. \n\nThe unary + operator is deprecated in new solidity compiler versions.\n\n## Remediation\nThe weakness can be avoided by performing pre-condition checks on any math operation or using a vetted library for arithmetic calculations such as SafeMath developed by OpenZeppelin.\n\n## References\n* [HackerGold Bug Analysis](https://blog.zeppelin.solutions/hackergold-bug-analysis-68d893cad738)\n* [SafeMath by OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol)\n* [Disallow Unary plus](https://github.com/ethereum/solidity/issues/1760)\n",
"markdown": "# Title\nTypographical Error\n\n## Relationships\n[CWE-480: Use of Incorrect Operator](https://cwe.mitre.org/data/definitions/480.html)\n\n## Description\nA typographical error can occur for example when the intent of a defined operation is to sum a number to a variable (+=) but it has accidentally been defined in a wrong way (=+), introducing a typo which happens to be a valid operator. Instead of calculating the sum it initializes the variable again. \n\nThe unary + operator is deprecated in new solidity compiler versions.\n\n## Remediation\nThe weakness can be avoided by performing pre-condition checks on any math operation or using a vetted library for arithmetic calculations such as SafeMath developed by OpenZeppelin.\n\n## References\n* [HackerGold Bug Analysis](https://blog.zeppelin.solutions/hackergold-bug-analysis-68d893cad738)\n* [SafeMath by OpenZeppelin](https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol)\n* [Disallow Unary plus](https://github.com/ethereum/solidity/issues/1760)\n",
"content": {
"Title": "Typographical Error",
"Relationships": "[CWE-597: Use of Wrong Operator in String Comparison](https://cwe.mitre.org/data/definitions/480.html)",
"Relationships": "[CWE-480: Use of Incorrect Operator](https://cwe.mitre.org/data/definitions/480.html)",
"Description": "A typographical error can occur for example when the intent of a defined operation is to sum a number to a variable (+=) but it has accidentally been defined in a wrong way (=+), introducing a typo which happens to be a valid operator. Instead of calculating the sum it initializes the variable again. \n\n\nThe unary + operator is deprecated in new solidity compiler versions.",
"Remediation": "The weakness can be avoided by performing pre-condition checks on any math operation or using a vetted library for arithmetic calculations such as SafeMath developed by OpenZeppelin."
}
Expand Down

0 comments on commit 18c484f

Please sign in to comment.