dongjoon-hyun opened a new pull request, #2680:
URL: https://github.com/apache/orc/pull/2680

   ### What changes were proposed in this pull request?
   
   This PR aims to reject a negative decoded dictionary entry length in the 
Java string dictionary reader by throwing a `FileFormatException` in 
`StringDictionaryTreeReader.readDictionaryLengthStream`.
   
   ### Why are the changes needed?
   
   A corrupt file can encode a negative entry length in the LENGTH stream, 
making `dictionaryOffsets` non-monotonic and causing `setRef` to receive a 
negative length. The C++ reader already rejects this case 
(`DictionaryLoader.cc`), so this restores C++/Java reader parity.
   
   ### How was this patch tested?
   
   Pass the CIs with a newly added test case, 
`TestStringDictionaryTreeReader#testNegativeDictionaryEntryLength`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Fable 5


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