From owner-freebsd-net Mon Oct 8 17:46:29 2001 Delivered-To: freebsd-net@freebsd.org Received: from holly.dyndns.org (adsl-208-191-149-224.dsl.hstntx.swbell.net [208.191.149.224]) by hub.freebsd.org (Postfix) with ESMTP id 38B1837B406; Mon, 8 Oct 2001 17:46:23 -0700 (PDT) Received: (from chris@localhost) by holly.dyndns.org (8.11.6/8.9.3) id f990krF06222; Mon, 8 Oct 2001 19:46:54 -0500 (CDT) (envelope-from chris) Date: Mon, 8 Oct 2001 19:46:43 -0500 From: Chris Costello To: Mike Barcroft Cc: "Todd C. Miller" , Peter Pentchev , freebsd-net@FreeBSD.ORG, freebsd-audit@FreeBSD.ORG Subject: Re: Final Patch for Review (was Re: [CFR] whois(1) out-of-bound access patch) Message-ID: <20011008194642.A696@holly.calldei.com> Reply-To: chris@FreeBSD.ORG References: <20011004121640.C1959@ringworld.oblivion.bg> <20011004121933.B31795@coffee.q9media.com> <200110041650.f94GoL10010161@xerxes.courtesan.com> <20011007203852.G37270@coffee.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011007203852.G37270@coffee.q9media.com>; from mike@FreeBSD.ORG on Sun, Oct 07, 2001 at 08:38:52PM -0400 Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sunday, October 07, 2001, Mike Barcroft wrote: > for (i = 0; ip_whois[i] != NULL; i++) { > - if (strstr(buf, ip_whois[i]) == NULL) > + if (strnstr(buf, ip_whois[i], len) == > + NULL) > continue; > s_asprintf(&nhost, "%s", ip_whois[i]); > + break; Should be for (i = 0; ip_whois[i] != NULL; i++) { if (strnstr(buf, ip_whois[i]) != NULL) { s_asprintf(&nhost, "%s", ip_whois[i]); break; } } for simplicity's sake. -- +-------------------+------------------------------------------+ | Chris Costello | To iterate is human; to recurse, divine. | | chris@FreeBSD.org | | +-------------------+------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message