FasterXML / FasterXML/jackson-dataformats-binary

(avro) Support `StreamReadConstraints.maxDocumentLength` and `maxTokenCount` in Avro parser

Open
#785 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
347
Forks
156
Avg merge
3d 3h
Merged PRs (30d)
22

Description

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).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.