Closed 0xbok closed 2 years ago
Nice find! I didn't know this pattern existed. Would you be able to write a test case for a large amount of return data?
@calvbore sure, will do.
ok, this was a false positive. Since the interface expects bytes4 in return value, only 4 bytes are copied in memory. closing.
We pass only
30_000
gas to ejected receiver so that it doesn't consume all gas. However, it can still causeduplicate()
to go OOG by returning a large amount of data. This data gets copied in memory.Fix is to use
ExecessivelySafeCall
library which doesn't copy the return data to memory.