You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zookeeper.apache.org by ke...@apache.org on 2024/10/28 05:37:46 UTC
(zookeeper) branch branch-3.9 updated (fc7f8c29e -> c18cd9ede)
This is an automated email from the ASF dual-hosted git repository.
kezhuw pushed a change to branch branch-3.9
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
from fc7f8c29e Prepared 3.9.4-SNAPSHOT
new f5ed8aa89 ZOOKEEPER-4848: Fix potential stack overflow in setup_random
new c18cd9ede ZOOKEEPER-4699: Fix hostname use-after-free in the C client
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
zookeeper-client/zookeeper-client-c/src/zookeeper.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(zookeeper) 01/02: ZOOKEEPER-4848: Fix potential stack overflow in setup_random
Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kezhuw pushed a commit to branch branch-3.9
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
commit f5ed8aa898b83c1edd69b9bb6df34a677e597d15
Author: yarthur1 <30...@users.noreply.github.com>
AuthorDate: Fri Oct 18 09:44:30 2024 +0800
ZOOKEEPER-4848: Fix potential stack overflow in setup_random
Reviewers: kezhuw, ztzg
Author: yarthur1
Closes #2097 from yarthur1/master
(cherry picked from commit fe4854a72a1557a588c25f8251b0681c6be835b3)
---
zookeeper-client/zookeeper-client-c/src/zookeeper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index 74b047171..5101f0bde 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -730,7 +730,7 @@ static void setup_random()
/* Assert we either read something or we were interrupted due to a
* signal (errno == EINTR) in which case we need to retry.
*/
- int rc = read(fd, &seed + seed_len, sizeof(seed) - seed_len);
+ int rc = read(fd, (char *)&seed + seed_len, sizeof(seed) - seed_len);
assert(rc > 0 || errno == EINTR);
if (rc > 0) {
seed_len += rc;
(zookeeper) 02/02: ZOOKEEPER-4699: Fix hostname use-after-free in the C client
Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kezhuw pushed a commit to branch branch-3.9
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
commit c18cd9ede944c58db7a2af46e36409ff34a87313
Author: fanyang <fa...@smartx.com>
AuthorDate: Fri Oct 18 09:52:41 2024 +0800
ZOOKEEPER-4699: Fix hostname use-after-free in the C client
Reviewers: kezhuw, ztzg
Author: fanyang89
Closes #2138 from fanyang89/fix-c-client-hostname-uaf
(cherry picked from commit e72f80aa38f47ac84db1bd0dadbb85f87595511e)
---
zookeeper-client/zookeeper-client-c/src/zookeeper.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index 5101f0bde..633bf3776 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -2558,8 +2558,9 @@ int zookeeper_interest(zhandle_t *zh, socket_t *fd, int *interest,
*tv = get_timeval(zh->recv_timeout/60);
zh->delay = 0;
- LOG_WARN(LOGCALLBACK(zh), "Delaying connection after exhaustively trying all servers [%s]",
- zh->hostname);
+ lock_reconfig(zh);
+ LOG_WARN(LOGCALLBACK(zh), "Delaying connection after exhaustively trying all servers [%s]", zh->hostname);
+ unlock_reconfig(zh);
} else {
if (addr_rw_server) {
zh->addr_cur = *addr_rw_server;