View | Details | Raw Unified | Return to bug 243862 | Differences between
and this patch

Collapse All | Expand All

(-)b/usr.bin/whois/whois.c (-1 / +15 lines)
Lines 533-541 whois(const char *query, const char *hostname, int flags) Link Here
533
				SCAN(p, buf+len, *p == ' ');
533
				SCAN(p, buf+len, *p == ' ');
534
				host = p;
534
				host = p;
535
				SCAN(p, buf+len, ishost(*p));
535
				SCAN(p, buf+len, ishost(*p));
536
				if (p > host)
536
				if (p > host || *p == ':')
537
					s_asprintf(&nhost, "%.*s",
537
					s_asprintf(&nhost, "%.*s",
538
						   (int)(p - host), host);
538
						   (int)(p - host), host);
539
				if (*p == ':') {
540
					char *pstr = ++p;
541
					char *nport;
542
					SCAN(p, buf+len, isdigit(*p));
543
					if (p > pstr && (p - pstr) < 6) {
544
						s_asprintf(&nport, "%.*s",
545
							(int)(p - pstr), pstr);
546
						port = nport;
547
						break;
548
					}
549
550
					/* Invalid port; don't recurse */
551
					nhost = NULL;
552
				}
539
				break;
553
				break;
540
			}
554
			}
541
			for (i = 0; actually_arin[i] != NULL; i++) {
555
			for (i = 0; actually_arin[i] != NULL; i++) {

Return to bug 243862