mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #9836 from ethereum/fix-missing-check-for-nested-dynamic-arrays-with-abi-encode-decode-v1
Add missing check for nested dynamic arrays in abi.encode()/decode() functions in ABIEncoderV1
This commit is contained in:
@@ -344,10 +344,16 @@ TypePointer Type::fullEncodingType(bool _inLibraryCall, bool _encoderV2, bool) c
|
||||
return encodingType;
|
||||
TypePointer baseType = encodingType;
|
||||
while (auto const* arrayType = dynamic_cast<ArrayType const*>(baseType))
|
||||
{
|
||||
baseType = arrayType->baseType();
|
||||
if (dynamic_cast<StructType const*>(baseType))
|
||||
if (!_encoderV2)
|
||||
|
||||
auto const* baseArrayType = dynamic_cast<ArrayType const*>(baseType);
|
||||
if (!_encoderV2 && baseArrayType && baseArrayType->isDynamicallySized())
|
||||
return nullptr;
|
||||
}
|
||||
if (!_encoderV2 && dynamic_cast<StructType const*>(baseType))
|
||||
return nullptr;
|
||||
|
||||
return encodingType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user