iemejia commented on code in PR #3857:
URL: https://github.com/apache/avro/pull/3857#discussion_r3564663056


##########
lang/csharp/src/apache/main/File/DataFileReader.cs:
##########
@@ -335,6 +335,11 @@ public bool HasNext()
                     {
                         _currentBlock = NextRawBlock(_currentBlock);
                         _currentBlock.Data = 
_codec.Decompress(_currentBlock.Data, (int)_blockSize);
+                        // Guard against a block that decompresses to more 
than the
+                        // allowed maximum (a decompression bomb). The 
built-in deflate
+                        // codec is already bounded during decompression; this 
covers
+                        // any codec that returns a fully decompressed buffer.
+                        Codec.CheckDecompressLength(_currentBlock.Data.Length, 
Codec.GetMaxDecompressLength());

Review Comment:
   Fixed. `HasNext()` now passes the original exception as the inner exception 
(and uses `e.Message` in the wrapper text), so the underlying cause and stack 
trace are preserved for callers. Pushed in f8c8e1d.



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