[
https://issues.apache.org/jira/browse/AVRO-4278?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ismaël Mejía updated AVRO-4278:
-------------------------------
Fix Version/s: 1.12.2
> [c++] Bound collection size when decoding arrays and maps in GenericReader
> --------------------------------------------------------------------------
>
> Key: AVRO-4278
> URL: https://issues.apache.org/jira/browse/AVRO-4278
> Project: Apache Avro
> Issue Type: Sub-task
> Components: c++
> Affects Versions: 1.11.5, 1.12.1
> Reporter: Ismaël Mejía
> Assignee: Ismaël Mejía
> Priority: Major
> Fix For: 1.12.2
>
>
> {{GenericReader::read()}} ({{lang/c++/impl/Generic.cc}}) handles the array
> and map cases by calling {{r.resize(r.size() + m)}}, where {{m}} is the block
> count returned by {{Decoder::arrayStart()}} / {{mapStart()}} /
> {{arrayNext()}} / {{mapNext()}}. {{BinaryDecoder::doDecodeItemCount()}}
> returns this count without any upper bound, so the vector is grown to the
> requested size before any element is read.
> Add validation of the block count (per block and cumulatively) against a
> configurable maximum before resizing, and reject counts that would exceed it.
> Preferably enforce the bound in the decoder's item-count path so all
> consumers benefit. Add a test covering a small input that declares an
> oversized block count.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)