Commits


Dmitry Kalinkin authored and Korn, Uwe committed 90fb5a37b7a
ARROW-2571: [C++] Lz4Codec doesn't properly handle empty data From the lz4 manual [1]: int LZ4_compress_default(const char* src, char* dst, int srcSize, int dstCapacity); return : the number of bytes written into buffer 'dst' (necessarily <= dstCapacity) or 0 if compression fails int LZ4_decompress_safe (const char* src, char* dst, int compressedSize, int dstCapacity); return : the number of bytes decompressed into destination buffer (necessarily <= dstCapacity) If destination buffer is not large enough, decoding will stop and output an error code (negative value). If the source stream is detected malformed, the function will stop decoding and return a negative result. This function is protected against malicious data packets. Fixes: 83a4405ea0 ('ARROW-599: [C++] Lz4 compression codec support') [1] https://github.com/lz4/lz4/blob/bf6fd938e522150e2a30bee978102769a51f4b3e/doc/lz4_manual.html#L64 Author: Dmitry Kalinkin <dkalinkin@bnl.gov> Closes #2032 from veprbl/pr/ARROW-2571 and squashes the following commits: e768eded <Dmitry Kalinkin> ARROW-2571: use data.data() instead of &data, as latter has side effects 2a512864 <Dmitry Kalinkin> ARROW-2571: add a test case e263bf3b <Dmitry Kalinkin> ARROW-2571: fix Lz4Codec to properly handle empty data