aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bridges.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-04-17 19:44:09 -0400
committerNick Mathewson <nickm@torproject.org>2018-04-17 19:45:59 -0400
commit3bf9974b6c4ee9f2a8204c058e1b7c206b99d620 (patch)
tree4af8bb79b71cea6f01f5f082aabd949a094d211f /src/test/test_bridges.c
parent1abe0a5769f3fe7c2a36975acd8ab1e861925f51 (diff)
downloadtor-3bf9974b6c4ee9f2a8204c058e1b7c206b99d620.tar.gz
tor-3bf9974b6c4ee9f2a8204c058e1b7c206b99d620.zip
Fix a pointer size error in test_bridges.c
sizeof(ret) is the size of the pointer, not the size of what it points to. Fortunately, we already have a function to compare tor_addr_port_t values for equality. Bugfix on c2c5b13e5d8a77e; bug not in any released Tor. Found by clang's scan-build.
Diffstat (limited to 'src/test/test_bridges.c')
-rw-r--r--src/test/test_bridges.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test_bridges.c b/src/test/test_bridges.c
index b5bd27e098..c4a4cacd98 100644
--- a/src/test/test_bridges.c
+++ b/src/test/test_bridges.c
@@ -234,7 +234,7 @@ test_bridges_get_configured_bridge_by_orports_digest(void *arg)
ret = get_configured_bridge_by_orports_digest(digest, orports);
tt_ptr_op(ret, OP_NE, NULL);
- tt_mem_op(addrport1, OP_EQ, bridge_get_addr_port(ret), sizeof(ret));
+ tt_assert(tor_addr_port_eq(addrport1, bridge_get_addr_port(ret)));
done:
smartlist_free(orports);