Skip to content

Commit d072856

Browse files
committed
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.
1 parent 7a4cc10 commit d072856

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
37e68ca853cd8b01b26c8d8c61d1db6546c08ed294f5650b691b7aadaf47ee18 /usr/local/bin/tox-bootstrapd
1+
b3fb4157d7fc6cd3455f40020bb6b69e5bab4bbdb6ce66d5bc7095146ba5a49e /usr/local/bin/tox-bootstrapd

toxcore/network.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ bool net_connect(const Logger *log, Socket sock, const IP_Port *ip_port)
16891689
if (!should_ignore_connect_error(error)) {
16901690
char *net_strerror = net_new_strerror(error);
16911691
LOGGER_ERROR(log, "failed to connect to %s:%d: %d (%s)",
1692-
ip_str.buf, ip_port->port, error, net_strerror);
1692+
net_ip_ntoa(&ip_port->ip, &ip_str), ip_port->port, error, net_strerror);
16931693
net_kill_strerror(net_strerror);
16941694
return false;
16951695
}

0 commit comments

Comments
 (0)