iemejia opened a new pull request, #3932:
URL: https://github.com/apache/avro/pull/3932

   ## What is the purpose of the change
   
   Decoder hardening across the SDKs now rejects a range of malformed binary
   encodings (overlong varints, `Long.MIN_VALUE` collection block counts,
   out-of-range union branch and enum symbol indices, negative bytes/string
   lengths), but there is no shared cross-language fixture guaranteeing that 
every
   SDK rejects the same malformed inputs identically, so the SDKs can drift (one
   accepts what another rejects).
   
   This adds a shared set of must-reject vectors under
   `share/test/data/binary-rejections.json`, each a schema plus a raw binary
   payload (hex) that a conformant decoder must reject with a bounded,
   well-defined error rather than accepting it, crashing, or exhausting memory.
   It seeds the set with cases already fixed per SDK, and wires thin per-SDK
   harnesses (Java and Python) that load the vectors and assert rejection.
   
   The shared fixture is a single cross-language artifact, so it is kept 
together
   with its first consumers here; additional SDK harnesses can be added later as
   small changes on top of the merged fixture.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Added `share/test/data/binary-rejections.json` with 9 seed vectors.
   - Added the Java harness `TestBinaryDecodingRejections`, which asserts each
     vector is rejected on both the classic and fast reader paths.
   - Added the Python harness `test_binary_decoding_rejections.py`, which 
asserts
     each vector is rejected with a bounded `AvroException`.
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (no — shared conformance 
test
     fixtures)
   - If yes, how is the feature documented? (the fixture file carries a
     self-describing `description` field explaining the format and intent)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to