I am looking at the assembly in Proxy.sol (reference below)
Question: What if someone calls the Proxy with some malformed / extremely large piece of data, won’t calldatacopy have free reign over the entire memory? Overwriting free memory pointer at 0x40 etc.? Also, can the same be said for returndatacopy? I know returndata will be from our implementation logic, so it shouldn’t be malformed.
I’m sure there’s some simple answer, ie. “memory is independent for each subsequent call, so as long as we don’t return to non-assembly in this contract’s call frame, memory doesn’t matter since nothing will access it in any meaningful way.”
I don’t know the answer unfortunately, I tried looking through the Solidity documentation on assembly/Yul but didn’t find the simple answer. I will see what I can find out or hopefully someone from the community can provide the answer.