[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-3741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mate Szalay-Beko updated ZOOKEEPER-3741:
----------------------------------------
    Description: 
Using new RHEL / Centos8 docker images, it was not possible to build the 
ZooKeeper C client for 3.5.5 and 3.5.6. The compilation error was fixed by 
[~ztzg] in ZOOKEEPER-3719 for branch 3.5 and 3.5.7. But one of the errors is 
still present on the master branch.

We had a warning that we are trying to call like 
{{sprintf(buf,"%s:%d",addrstr,port);}}, and both {{buf}} and {{addrstr}} are 
128 long char arrays. So in theory, we can overflow. The fix is to increase the 
length of the destination string array ({{buf}}).

Actually this problem only causing compile time warning / failure only on the 
3.5.5 and 3.5.6. On 3.5.7 this was fixed and on 3.6+ branches the compiler can 
not detect the problem due to some code refactoring made by ZOOKEEPER-3068, but 
the issue is still present on the master branch.



  was:
Using new RHEL / Centos8 docker images, it is not possible to build the 
ZooKeeper C client for branch 3.5.

The proposed fixes:
- first cherry-pick to branch-3.5 the ZOOKEEPER-3302 fix from the master / 3.6 
branch made by [~eolivelli]: 
https://github.com/apache/zookeeper/commit/450869006e0f62790e974305eb079e1b0450dbfd
 
- then apply my PR both on master, 3.6 and 3.5 (this is fixing an issue what is 
present both on branch 3.5 and master, but it doesn't trigger a compilation 
failure on the master branch since the compiler can not detect the issue there 
due to some code refactoring made by ZOOKEEPER-3068)


Update: unfortunately I will have to make a separate PR for branch-3.5, as my 
original fix is compatible only with master and branch-3.6.


> Fix ZooKeeper 3.5 C client build on Fedora8
> -------------------------------------------
>
>                 Key: ZOOKEEPER-3741
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-3741
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: c client
>    Affects Versions: 3.6.0
>            Reporter: Mate Szalay-Beko
>            Assignee: Mate Szalay-Beko
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.7.0, 3.6.1
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Using new RHEL / Centos8 docker images, it was not possible to build the 
> ZooKeeper C client for 3.5.5 and 3.5.6. The compilation error was fixed by 
> [~ztzg] in ZOOKEEPER-3719 for branch 3.5 and 3.5.7. But one of the errors is 
> still present on the master branch.
> We had a warning that we are trying to call like 
> {{sprintf(buf,"%s:%d",addrstr,port);}}, and both {{buf}} and {{addrstr}} are 
> 128 long char arrays. So in theory, we can overflow. The fix is to increase 
> the length of the destination string array ({{buf}}).
> Actually this problem only causing compile time warning / failure only on the 
> 3.5.5 and 3.5.6. On 3.5.7 this was fixed and on 3.6+ branches the compiler 
> can not detect the problem due to some code refactoring made by 
> ZOOKEEPER-3068, but the issue is still present on the master branch.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to