iemejia commented on code in PR #3854:
URL: https://github.com/apache/avro/pull/3854#discussion_r3564713868
##########
lang/c++/impl/ZstdDecompressWrapper.cc:
##########
@@ -43,9 +43,20 @@ std::string ZstdDecompressWrapper::decompress(const
std::vector<char> &compresse
if (ZSTD_isError(ret)) {
throw Exception("ZSTD decompression error: {}",
ZSTD_getErrorName(ret));
}
+ // Reject before appending so the buffer never grows past the
limit.
+ if (out.pos > maxLength - uncompressed.size()) {
+ throw Exception(
+ "Decompressed block size exceeds the maximum allowed of {}
bytes", maxLength);
+ }
Review Comment:
Fixed. The zstd streaming path now includes the would-be decompressed size
(current size plus the pending chunk) in the exception message, matching the
fixed-size zstd and Snappy paths. Pushed in 7ed107b.
--
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]