mirror of
https://github.com/tornadocash/tornado-core.git
synced 2024-12-11 00:24:22 -05:00
check return data length for tokens
This commit is contained in:
parent
8a179b9217
commit
c00e553299
@ -57,6 +57,7 @@ contract ERC20Mixer is Mixer {
|
|||||||
|
|
||||||
// if contract returns some data let's make sure that is `true` according to standard
|
// if contract returns some data let's make sure that is `true` according to standard
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
require(data.length == 32, "data length should be either 0 or 32 bytes");
|
||||||
assembly {
|
assembly {
|
||||||
success := mload(add(data, 0x20))
|
success := mload(add(data, 0x20))
|
||||||
}
|
}
|
||||||
@ -78,6 +79,7 @@ contract ERC20Mixer is Mixer {
|
|||||||
|
|
||||||
// if contract returns some data let's make sure that is `true` according to standard
|
// if contract returns some data let's make sure that is `true` according to standard
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
|
require(data.length == 32, "data length should be either 0 or 32 bytes");
|
||||||
assembly {
|
assembly {
|
||||||
success := mload(add(data, 0x20))
|
success := mload(add(data, 0x20))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user