From d0728560bc308fe2ef5320d12c3e6021f13cc5d7 Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 4 Apr 2022 10:33:15 +0000 Subject: [PATCH] fix: Format IP as string again in error log. In case DEBUG logging is disabled, the formatting done in the `LOGGER_DEBUG` statement above will not occur, leaving uninitialised memory here. --- other/bootstrap_daemon/docker/tox-bootstrapd.sha256 | 2 +- toxcore/network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index d35a2c7e..5df2d65f 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -37e68ca853cd8b01b26c8d8c61d1db6546c08ed294f5650b691b7aadaf47ee18 /usr/local/bin/tox-bootstrapd +b3fb4157d7fc6cd3455f40020bb6b69e5bab4bbdb6ce66d5bc7095146ba5a49e /usr/local/bin/tox-bootstrapd diff --git a/toxcore/network.c b/toxcore/network.c index 10bbf639..c6cb60bb 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -1689,7 +1689,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port) if (!should_ignore_connect_error(error)) { char *net_strerror = net_new_strerror(error); LOGGER_ERROR(log, "failed to connect to %s:%d: %d (%s)", - ip_str.buf, ip_port->port, error, net_strerror); + net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port, error, net_strerror); net_kill_strerror(net_strerror); return false; }