Skip to content

Commit

Permalink
Merge pull request #48 from Hyuntae-91/master
Browse files Browse the repository at this point in the history
Translated and Updated document to Version 0.5.1
  • Loading branch information
Hyuntae Kim committed Dec 11, 2018
2 parents 16ff26d + 5422c14 commit 0b7cbb9
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 445 deletions.
34 changes: 34 additions & 0 deletions bugs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
[
{
"name": "ExpExponentCleanup",
"summary": "Using the ** operator with an exponent of type shorter than 256 bits can result in unexpected values.",
"description": "Higher order bits in the exponent are not properly cleaned before the EXP opcode is applied if the type of the exponent expression is smaller than 256 bits and not smaller than the type of the base. In that case, the result might be larger than expected if the exponent is assumed to lie within the value range of the type. Literal numbers as exponents are unaffected as are exponents or bases of type uint256.",
"fixed": "0.4.25",
"severity": "medium/high",
"check": {"regex-source": "[^/]\\*\\* *[^/0-9 ]"}
},
{
"name": "EventStructWrongData",
"summary": "Using structs in events logged wrong data.",
"description": "If a struct is used in an event, the address of the struct is logged instead of the actual data.",
"introduced": "0.4.17",
"fixed": "0.4.25",
"severity": "very low",
"check": {"ast-compact-json-path": "$..[?(@.nodeType === 'EventDefinition')]..[?(@.nodeType === 'UserDefinedTypeName' && @.typeDescriptions.typeString.startsWith('struct'))]"}
},
{
"name": "NestedArrayFunctionCallDecoder",
"summary": "Calling functions that return multi-dimensional fixed-size arrays can result in memory corruption.",
"description": "If Solidity code calls a function that returns a multi-dimensional fixed-size array, array elements are incorrectly interpreted as memory pointers and thus can cause memory corruption if the return values are accessed. Calling functions with multi-dimensional fixed-size arrays is unaffected as is returning fixed-size arrays from function calls. The regular expression only checks if such functions are present, not if they are called, which is required for the contract to be affected.",
"introduced": "0.1.4",
"fixed": "0.4.22",
"severity": "medium",
"check": {"regex-source": "returns[^;{]*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\]\\s*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\][^{;]*[;{]"}
},
{
"name": "OneOfTwoConstructorsSkipped",
"summary": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored.",
"description": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored. There will be a compiler warning about the old-style constructor, so contracts only using new-style constructors are fine.",
"introduced": "0.4.22",
"fixed": "0.4.23",
"severity": "very low"
},
{
"name": "ZeroFunctionSelector",
"summary": "It is possible to craft the name of a function such that it is executed instead of the fallback function in very specific circumstances.",
Expand Down
11 changes: 11 additions & 0 deletions bugs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@
๋ฒ„๊ทธ๋ฅผ ์œ ๋ฐœํ•˜๋Š” ์กฐ๊ฑด. ํ˜„์žฌ ์ด ๊ฐ์ฒด๋Š” ๋ถ€์šธ๊ฐ’ ``optimizer`` ๋ฅผ ํฌํ•จ
ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฆ‰, ๋ฒ„๊ทธ๋ฅผ ํ™œ์„ฑํ™”ํ•˜๋ ค๋ฉด optimizer๋ฅผ ์ผœ์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์กฐ๊ฑด์ด ์ฃผ์–ด์ง€์ง€ ์•Š์œผ๋ฉด, ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋‹ค๊ณ  ๊ฐ„์ฃผ๋ฉ๋‹ˆ๋‹ค.
๊ฒ€์‚ฌ
์ด ํ•„๋“œ์—๋Š” ์Šค๋งˆํŠธ ์ปจํŠธ๋ž™ํŠธ๊ฐ€ ๋ฒ„๊ทธ๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ์—†๋Š”์ง€๋ฅผ
๋ณด๊ณ ํ•˜๋Š” ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๊ฒ€์‚ฌ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฒซ ๋ฒˆ์งธ ๊ฒ€์‚ฌ ์œ ํ˜•์€ Javascript
์ •๊ทœ์‹์ž…๋‹ˆ๋‹ค. ์ด๋Š” ๋ฒ„๊ทธ๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ ์†Œ์Šค ์ฝ”๋“œ("source-regex")์™€
์ผ์น˜ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ์ผ์น˜ํ•˜๋Š” ํ•ญ๋ชฉ์ด ์—†๋‹ค๋ฉด, ๋ฒ„๊ทธ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์„ ๊ฐ€๋Šฅ์„ฑ์ด
๋†’์Šต๋‹ˆ๋‹ค. ๋ฐ˜๋Œ€๋กœ, ์ผ์น˜ํ•˜๋Š” ํ•ญ๋ชฉ์ด ์žˆ๋‹ค๋ฉด, ๋ฒ„๊ทธ๊ฐ€ ์กด์žฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
์ •ํ™•์„ฑ์„ ๋†’์ด๊ธฐ ์œ„ํ•ด์„œ stripping ์ฃผ์„์„ ์ง€์šด ๋’ค, ์†Œ์Šค ์ฝ”๋“œ์— ๊ฒ€์‚ฌ๋ฅผ
์ ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋‘๋ฒˆ์งธ ๊ฒ€์‚ฌ ์œ ํ˜•์€ Solidity ํ”„๋กœ๊ทธ๋žจ์˜ ์†Œํ˜•
AST("ast-compact-json-path")์—์„œ ๊ฒ€์‚ฌ ํ•  ํŒจํ„ด์ž…๋‹ˆ๋‹ค. ํŠน๋ณ„ํ•œ ๊ฒ€์ƒ‰
์ฟผ๋ฆฌ๋Š” JsonPath ํ‘œํ˜„์‹์ž…๋‹ˆ๋‹ค. Solidity AST์˜ ๊ฒฝ๋กœ๊ฐ€ ์ฟผ๋ฆฌ์™€ ํ•˜๋‚˜๋ผ๋„
์ผ์น˜ํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ, ๋ฒ„๊ทธ๊ฐ€ ์กด์žฌ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

.. literalinclude:: bugs.json
:language: js

0 comments on commit 0b7cbb9

Please sign in to comment.