zserio
zserio copied to clipboard
Argument values of parameterized types for arrays are not properly checked
Arguments of parameterized types for arrays are not checked at all during writing. Consider the following:
struct ArrayHolder(varsize size, uint8 extraLimit)
{
varuint array[size];
bit:3 extraValue : extraValue <= extraLimit;
};
struct FixedAndVariableParam
{
uint8 extraLimit;
ArrayHolder(1000, extraLimit) arrayHolder[];
};
User can initialize any element of arrayHolder
array with completely different extraLimit
value than field extraLimit
contains.
Connected to the issue #378.