Skip to content

Commit

Permalink
ZOOKEEPER-4699: Fix hostname use-after-free in the C client
Browse files Browse the repository at this point in the history
Reviewers: kezhuw, ztzg
Author: fanyang89
Closes #2138 from fanyang89/fix-c-client-hostname-uaf

(cherry picked from commit e72f80a)
  • Loading branch information
fanyang89 authored and kezhuw committed Oct 28, 2024
1 parent f5ed8aa commit c18cd9e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions zookeeper-client/zookeeper-client-c/src/zookeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c18cd9e

Please sign in to comment.