Skip to content

Commit b45bc39

Browse files
authored
Merge pull request #13045 from ethereum/bytesArrayToStorageBug
Bytes array to storage bug
2 parents dccc06c + 27822db commit b45bc39

27 files changed

+238
-136
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### 0.8.15 (unreleased)
22

33
Important Bugfixes:
4+
* Code Generation: Avoid writing dirty bytes to storage when copying ``bytes`` arrays.
45
* Yul Optimizer: Keep all memory side-effects of inline assembly blocks.
56

67

docs/bugs.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
[
2+
{
3+
"uid": "SOL-2022-5",
4+
"name": "DirtyBytesArrayToStorage",
5+
"summary": "Copying ``bytes`` arrays from memory or calldata to storage may result in dirty storage values.",
6+
"description": "Copying ``bytes`` arrays from memory or calldata to storage is done in chunks of 32 bytes even if the length is not a multiple of 32. Thereby, extra bytes past the end of the array may be copied from calldata or memory to storage. These dirty bytes may then become observable after a ``.push()`` without arguments to the bytes array in storage, i.e. such a push will not result in a zero value at the end of the array as expected. This bug only affects the legacy code generation pipeline, the new code generation pipeline via IR is not affected.",
7+
"link": "https://blog.soliditylang.org/2022/06/15/dirty-bytes-array-to-storage-bug/",
8+
"introduced": "0.0.1",
9+
"fixed": "0.8.15",
10+
"severity": "low"
11+
},
212
{
313
"uid": "SOL-2022-4",
414
"name": "InlineAssemblyMemorySideEffects",

0 commit comments

Comments
 (0)