You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@orc.apache.org by do...@apache.org on 2020/08/11 18:12:44 UTC

[orc] branch branch-1.6 updated: ORC-659: Initialize "next_in" before calling DeflateInit2 (#514)

This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-1.6
in repository https://gitbox.apache.org/repos/asf/orc.git


The following commit(s) were added to refs/heads/branch-1.6 by this push:
     new 5412662  ORC-659: Initialize "next_in" before calling DeflateInit2 (#514)
5412662 is described below

commit 541266255cab2d7320c07da2d538f9b8ffd33c0b
Author: Ion GaztaƱaga <ig...@gmail.com>
AuthorDate: Tue Aug 11 06:49:16 2020 +0200

    ORC-659: Initialize "next_in" before calling DeflateInit2 (#514)
    
    ### What changes were proposed in this pull request?
    
    This PR aims to initialize `next_in` before calling DeflateInit2.
    
    ### Why are the changes needed?
    
    According to zlib documentation of DeflateInit2:
    
    _"This is another version of deflateInit with more compression options. The fields **next_in**, zalloc, zfree and opaque must be initialized before by the caller."_
    
    In an alpine docker DeflateInit2 was returning an error that seems to be solved with the patch.
    
    ### How was this patch tested?
    
    Pass UT.
    
    (cherry picked from commit cd2ce9f2db0a225fd612dcec3409317a1f60a149)
    Signed-off-by: Dongjoon Hyun <do...@apache.org>
---
 c++/src/Compression.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c++/src/Compression.cc b/c++/src/Compression.cc
index 362a641..041abbb 100644
--- a/c++/src/Compression.cc
+++ b/c++/src/Compression.cc
@@ -292,6 +292,7 @@ DIAGNOSTIC_PUSH
     strm.zalloc = nullptr;
     strm.zfree = nullptr;
     strm.opaque = nullptr;
+    strm.next_in = nullptr;
 
     if (deflateInit2(&strm, level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY)
         != Z_OK) {