[glib/mcatanzaro/kill-inet-aton] gresolver: use inet_pton()




commit c8e28ef2de11446a1a1a81e44563bd01db25c1fb
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Mon May 10 15:36:48 2021 -0500

    gresolver: use inet_pton()
    
    inet_aton() is obsolete and triggering a downstream disallowed function
    call checker. It can be trivially replaced with inet_pton() instead.

 gio/gresolver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gresolver.c b/gio/gresolver.c
index cd5445a65..3fcb346bf 100644
--- a/gio/gresolver.c
+++ b/gio/gresolver.c
@@ -369,10 +369,10 @@ handle_ip_address_or_localhost (const char                *hostname,
 
   /* Reject non-standard IPv4 numbers-and-dots addresses.
    * g_inet_address_new_from_string() will have accepted any "real" IP
-   * address, so if inet_aton() succeeds, then it's an address we want
+   * address, so if inet_pton() succeeds, then it's an address we want
    * to reject.
    */
-  if (inet_aton (hostname, &ip4addr))
+  if (inet_pton (AF_INET, hostname, &ip4addr))
 #endif
     {
 #ifdef G_OS_WIN32


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]