From 0bb59989883ca5f25b4131a73e9f783d29070972 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Tue, 26 Sep 2023 15:33:36 +0200 Subject: core: replace inet_addr() with inet_pton() man pages as well as rpminspect suggest that we shouldn't be using inet_addr(). --- src/core/wee-network.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/wee-network.c b/src/core/wee-network.c index 0e68d2bb1..3e7d4e2cf 100644 --- a/src/core/wee-network.c +++ b/src/core/wee-network.c @@ -554,11 +554,13 @@ network_pass_socks4proxy (struct t_proxy *proxy, int sock, const char *address, socks4.method = 1; socks4.port = htons (port); network_resolve (address, ip_addr, NULL); - socks4.address = inet_addr (ip_addr); strncpy (socks4.user, username, sizeof (socks4.user) - 1); free (username); + if (inet_pton (AF_INET, ip_addr, &socks4.address) != 1) + return 0; + length = 8 + strlen (socks4.user) + 1; if (network_send_with_retry (sock, (char *) &socks4, length, 0) != length) return 0; -- cgit v1.2.3