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

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


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

commit 117c8c5da22f820ac72be39c40a23d13f6f865e8
Author: Ion GaztaƱaga <[email protected]>
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 <[email protected]>
    (cherry picked from commit 541266255cab2d7320c07da2d538f9b8ffd33c0b)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 c++/src/Compression.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/c++/src/Compression.cc b/c++/src/Compression.cc
index 6bd0220..57dd638 100644
--- a/c++/src/Compression.cc
+++ b/c++/src/Compression.cc
@@ -280,6 +280,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) {

Reply via email to