mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 04:43:09 +03:00
arrow-cpp: fix for zstd 1.3.6+ (#48928)
This commit is contained in:
parent
53715963be
commit
c88e09d46f
@ -26,6 +26,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
# patch to fix python-test
|
||||
./darwin.patch
|
||||
|
||||
# facebook/zstd#1385
|
||||
./zstd136.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
17
pkgs/development/libraries/arrow-cpp/zstd136.patch
Normal file
17
pkgs/development/libraries/arrow-cpp/zstd136.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- a/src/arrow/util/compression_zstd.cc
|
||||
+++ b/src/arrow/util/compression_zstd.cc
|
||||
@@ -35,8 +35,13 @@ namespace util {
|
||||
|
||||
Status ZSTDCodec::Decompress(int64_t input_len, const uint8_t* input, int64_t output_len,
|
||||
uint8_t* output_buffer) {
|
||||
+ void *safe_output_buffer = static_cast<void*>(output_buffer);
|
||||
+ int dummy {};
|
||||
+ if ((output_len == 0) && (output_buffer == NULL)) {
|
||||
+ safe_output_buffer = static_cast<void*>(&dummy);
|
||||
+ }
|
||||
int64_t decompressed_size =
|
||||
- ZSTD_decompress(output_buffer, static_cast<size_t>(output_len), input,
|
||||
+ ZSTD_decompress(safe_output_buffer, static_cast<size_t>(output_len), input,
|
||||
static_cast<size_t>(input_len));
|
||||
if (decompressed_size != output_len) {
|
||||
return Status::IOError("Corrupt ZSTD compressed data.");
|
Loading…
Reference in New Issue
Block a user