FreeBSD Bugzilla – Attachment 211337 Details for
Bug 243862
[patch] whois(1) does not recurse to servers that include a port number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix patch
whois.port.diff (text/plain), 821 bytes, created by
ben
on 2020-02-04 07:15:18 UTC
(
hide
)
Description:
fix patch
Filename:
MIME Type:
Creator:
ben
Created:
2020-02-04 07:15:18 UTC
Size:
821 bytes
patch
obsolete
>diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c >index 47e71c2f535..f10658471dd 100644 >--- a/usr.bin/whois/whois.c >+++ b/usr.bin/whois/whois.c >@@ -533,9 +533,23 @@ whois(const char *query, const char *hostname, int flags) > SCAN(p, buf+len, *p == ' '); > host = p; > SCAN(p, buf+len, ishost(*p)); >- if (p > host) >+ if (p > host || *p == ':') > s_asprintf(&nhost, "%.*s", > (int)(p - host), host); >+ if (*p == ':') { >+ char *pstr = ++p; >+ char *nport; >+ SCAN(p, buf+len, isdigit(*p)); >+ if (p > pstr && (p - pstr) < 6) { >+ s_asprintf(&nport, "%.*s", >+ (int)(p - pstr), pstr); >+ port = nport; >+ break; >+ } >+ >+ /* Invalid port; don't recurse */ >+ nhost = NULL; >+ } > break; > } > for (i = 0; actually_arin[i] != NULL; i++) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 243862
:
211337
|
211359