Language: Python
Label: safe
CWE: CWE-789 \u2014 Memory Allocation with Excessive Size Value
The product allocates memory based on an untrusted, large size value, but it does not ensure that the size is within expected limits, allowing arbitrary amounts of memory to be allocated.

Code:
def test_allocator_overflow(get_contract):
    code = """
x: uint256
y: uint256[max_value(uint256)]
    """
    with pytest.raises(
        StorageLayoutException,
        match=f"Invalid storage slot for var y, tried to allocate slots 1 through {2**256}\n",
    ):
        get_contract(code)