From 0eff28c80f3e01d95a8aebc7d971e6c114b9a19f Mon Sep 17 00:00:00 2001 From: practicalswift Date: Sat, 14 Apr 2018 20:44:03 +0200 Subject: [PATCH] Assert our parse_wireaddr assumptions in run-ip_port_parsing.c We assume that the parse_wireaddr(...) calls return true. Otherwise addr.port will be uninitialized. --- common/test/run-ip_port_parsing.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/test/run-ip_port_parsing.c b/common/test/run-ip_port_parsing.c index 3d0dbf1eb..67e5017cd 100644 --- a/common/test/run-ip_port_parsing.c +++ b/common/test/run-ip_port_parsing.c @@ -73,17 +73,17 @@ int main(void) assert(!separate_address_and_port(tmpctx, "[::1]:http", &ip, &port)); // localhost hostnames for backward compat - parse_wireaddr("localhost", &addr, 200, NULL); + assert(parse_wireaddr("localhost", &addr, 200, NULL)); assert(addr.port == 200); // string should win the port battle - parse_wireaddr("[::1]:9735", &addr, 500, NULL); + assert(parse_wireaddr("[::1]:9735", &addr, 500, NULL)); assert(addr.port == 9735); ip = fmt_wireaddr(tmpctx, &addr); assert(streq(ip, "[::1]:9735")); // should use argument if we have no port in string - parse_wireaddr("2001:db8:85a3::8a2e:370:7334", &addr, 9777, NULL); + assert(parse_wireaddr("2001:db8:85a3::8a2e:370:7334", &addr, 9777, NULL)); assert(addr.port == 9777); ip = fmt_wireaddr(tmpctx, &addr);