From 30137d3b7e4f8aac35c7024002c942a44db7c4f2 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Wed, 18 Sep 2024 17:19:28 +0200 Subject: [PATCH] Type-check argument to network-lookup-address-info * src/process.c (Fnetwork_lookup_address_info): Check that the "name" argument is a string, and mention 'puny-encode-domain'. (Bug#73337) (cherry picked from commit 300d05ecb4cdd53eb8ae9c95f9db6909bb872e29) --- src/process.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/process.c b/src/process.c index 557bdfc918c..b71ba3daf2d 100644 --- a/src/process.c +++ b/src/process.c @@ -4710,6 +4710,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. @@ -4729,6 +4732,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; -- 2.39.5