Type-check argument to network-lookup-address-info
authorRobert Pluim <rpluim@gmail.com>
Wed, 18 Sep 2024 15:19:28 +0000 (17:19 +0200)
committerRobert Pluim <rpluim@gmail.com>
Thu, 19 Sep 2024 07:23:58 +0000 (09:23 +0200)
* src/process.c (Fnetwork_lookup_address_info): Check that the
"name" argument is a string, and mention 'puny-encode-domain'.
(Bug#73337)

src/process.c

index 9b44603c0474062a90edae7b1c34d95446fce1fa..58ce0f3e6ed1142d4c58ffbf942e1db61dbe441b 100644 (file)
@@ -4711,6 +4711,9 @@ network_lookup_address_info_1 (Lisp_Object host, const char *service,
 DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info,
        Snetwork_lookup_address_info, 1, 3, 0,
        doc: /* Look up Internet Protocol (IP) address info of NAME.
+NAME must be an ASCII-only string.  For looking up internationalized
+hostnames, use `puny-encode-domain' on the string first.
+
 Optional argument FAMILY controls whether to look up IPv4 or IPv6
 addresses.  The default of nil means both, symbol `ipv4' means IPv4
 only, symbol `ipv6' means IPv6 only.
@@ -4730,6 +4733,8 @@ returned from the lookup.  */)
   struct addrinfo *res, *lres;
   struct addrinfo hints;
 
+  CHECK_STRING (name);
+
   memset (&hints, 0, sizeof hints);
   if (NILP (family))
     hints.ai_family = AF_UNSPEC;