Views
No views yet
44f7aa35a6b90ac7d39ef0e68dad706561235941avro::Reader, avro::ValidatingReader, and
avro::ResolvingReader path does not check whether BufferReader::read()
reached EOF and does not bound the varint shift count.0x81) therefore
keeps the legacy decoder inside readVarInt() after the input is exhausted.
The last byte remains in val, its continuation bit remains set, and the loop
never reaches its exit condition. A process loading the 10-byte file consumes
a CPU core until it is terminated.BinaryDecoder rejects the same
datum as Invalid Avro varint.1git clone https://github.com/apache/avro.git
2cmake -S avro/lang/c++ -B avro-build \
3 -DCMAKE_BUILD_TYPE=RelWithDebInfo \
4 -DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-omit-frame-pointer -g" \
5 -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
6cmake --build avro-build --target avrocpp_s -j1AVRO_SRC=/path/to/avro/lang/c++ \
2AVRO_BUILD=/path/to/avro-build \
3./reproduce.sh1runtime error: shift exponent 70 is too large for 64-bit type 'uint64_t'
2trigger: modern BinaryDecoder rejected input: Invalid Avro varint
3trigger: legacy Reader decoded -4647998506761461825
4TIMEOUT: legacy Reader did not return after input EOF
5PASS: truncated input caused deterministic non-termination (exit 124)control.avro: valid one-byte raw Avro long datum, value 1.trigger-overlong.avro: 11-byte terminated overlong varint.trigger-truncated.avro: 10 continuation bytes with no terminator.poc.cpp: control, modern-decoder, and legacy-decoder differential.poc_hang.cpp: deterministic non-termination harness.reproduce.sh: build and reproduction commands.InputBuffer containing
that representation.1dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986 control.avro
26439afb84e6b735dbe05a6b434edc5dd5c7b7cf0e57165e1ffc5430d89a785ab trigger-overlong.avro
319386bb2036b5a0377ce28d0d069d61131fe668c292128cbd1783f9a29d80129 trigger-truncated.avroreader_.read(val) and throw an Avro parse
exception on EOF. Before shifting, reject shift >= 64, matching
BinaryDecoder::doDecodeLong().