Skip to content

Disallow empty root struct #341

@tigrannajaryan

Description

@tigrannajaryan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions