chiark / gitweb /
site: transport peers: fix incorrect stride when debug output enabled
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2012 00:24:41 +0000 (01:24 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 19:02:20 +0000 (20:02 +0100)
commita620a048db382ace2ab42cfe0f6e832de1197527
tree9566793947fc3bbaf25a506556b2a67e2f6cf76e
parent39a6b1e27fba043e9f988fa10f76ea68b796cbfd
site: transport peers: fix incorrect stride when debug output enabled

When there are multiple peer addresses, attempts to copy them from one
table of peers addresses to another with transport_peers_copy will go
wrong because the stride argument to transport_peers_debug is wrong -
we take sizeof() the pointer rather than of the array element.

This will typically cause a segfault if it happens, but the bug can
only be triggered if LOG_PEER_ADDRS debugging is enabled.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c