diff options
| author | Robert Pluim | 2024-09-18 17:19:28 +0200 |
|---|---|---|
| committer | Robert Pluim | 2024-09-19 09:23:58 +0200 |
| commit | 300d05ecb4cdd53eb8ae9c95f9db6909bb872e29 (patch) | |
| tree | 66b0145fef7ee9e41b2cf729dbef4ca9b4dd4fc1 /src/process.c | |
| parent | 0f0f21b7f27265e7c9c3a47dc6c9042324f2b031 (diff) | |
| download | emacs-300d05ecb4cdd53eb8ae9c95f9db6909bb872e29.tar.gz emacs-300d05ecb4cdd53eb8ae9c95f9db6909bb872e29.zip | |
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)
Diffstat (limited to 'src/process.c')
| -rw-r--r-- | src/process.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c index 9b44603c047..58ce0f3e6ed 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -4711,6 +4711,9 @@ network_lookup_address_info_1 (Lisp_Object host, const char *service, | |||
| 4711 | DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info, | 4711 | DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info, |
| 4712 | Snetwork_lookup_address_info, 1, 3, 0, | 4712 | Snetwork_lookup_address_info, 1, 3, 0, |
| 4713 | doc: /* Look up Internet Protocol (IP) address info of NAME. | 4713 | doc: /* Look up Internet Protocol (IP) address info of NAME. |
| 4714 | NAME must be an ASCII-only string. For looking up internationalized | ||
| 4715 | hostnames, use `puny-encode-domain' on the string first. | ||
| 4716 | |||
| 4714 | Optional argument FAMILY controls whether to look up IPv4 or IPv6 | 4717 | Optional argument FAMILY controls whether to look up IPv4 or IPv6 |
| 4715 | addresses. The default of nil means both, symbol `ipv4' means IPv4 | 4718 | addresses. The default of nil means both, symbol `ipv4' means IPv4 |
| 4716 | only, symbol `ipv6' means IPv6 only. | 4719 | only, symbol `ipv6' means IPv6 only. |
| @@ -4730,6 +4733,8 @@ returned from the lookup. */) | |||
| 4730 | struct addrinfo *res, *lres; | 4733 | struct addrinfo *res, *lres; |
| 4731 | struct addrinfo hints; | 4734 | struct addrinfo hints; |
| 4732 | 4735 | ||
| 4736 | CHECK_STRING (name); | ||
| 4737 | |||
| 4733 | memset (&hints, 0, sizeof hints); | 4738 | memset (&hints, 0, sizeof hints); |
| 4734 | if (NILP (family)) | 4739 | if (NILP (family)) |
| 4735 | hints.ai_family = AF_UNSPEC; | 4740 | hints.ai_family = AF_UNSPEC; |