Skip to content

Support StreamReadConstraints.maxDocumentLength and maxTokenCount in Avro parser #785

Description

@pjfanning

Two StreamReadConstraints settings are ignored by the Avro backend:

maxTokenCount: AvroParserImpl.nextToken() (and nextNameMatch()) assign _currToken directly instead of going through ParserMinimalBase._updateToken() / _nullSafeUpdateToken(), so tokens are never counted — currentTokenCount() stays 0 and the limit is never enforced. Only the nextName() variants count.

maxDocumentLength: no validateDocumentLength() calls anywhere — neither in JacksonAvroParserImpl's buffer reloads, nor up front for byte[] input in AvroFactory, nor for the Apache-decoder path (ApacheAvroParserImpl), which reads from the InputStream directly.

CBOR and Smile support both (see #649, #651).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions