-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Root struct like this must not be allowed:
struct Empty root {
}
A struct like this doesn't work since decoding it is a noop and never reaches the end of column, thus potentially allowing a very large number of such empty records to be "decoded" by Reader without making any progress. This makes protecting from invalid inputs hard.
We need to disallow this, since there is no plausible use case for a schema like this.
We probably should still allow empty non-root structs, which is a valid way to have a schema that can evolve by adding fields to empty struct. It does not suffer from the same problem since Reader will have to make some progress for non-empty root struct and will eventually reach end of column for root struct.
We need to disallow this in stefc and in decoders.