Commit d953381d authored by Mark Andrews's avatar Mark Andrews
Browse files

check returns from inet_pton()

(cherry picked from commit 9499adeb)
parent d792ed7a
Pipeline #46598 passed with stages
in 54 minutes and 34 seconds
......@@ -305,8 +305,10 @@ do_lookup_string(const char *addr, uint8_t *scope,
dns_geoip_elem_t elt;
struct in_addr in4;
isc_netaddr_t na;
int n;
inet_pton(AF_INET, addr, &in4);
n = inet_pton(AF_INET, addr, &in4);
assert_int_equal(n, 1);
isc_netaddr_fromin(&na, &in4);
elt.subtype = subtype;
......@@ -322,8 +324,10 @@ do_lookup_string_v6(const char *addr, uint8_t *scope,
dns_geoip_elem_t elt;
struct in6_addr in6;
isc_netaddr_t na;
int n;
inet_pton(AF_INET6, addr, &in6);
n = inet_pton(AF_INET6, addr, &in6);
assert_int_equal(n, 1);
isc_netaddr_fromin6(&na, &in6);
elt.subtype = subtype;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment