Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Oct 2001 19:46:43 -0500
From:      Chris Costello <chris@FreeBSD.ORG>
To:        Mike Barcroft <mike@FreeBSD.ORG>
Cc:        "Todd C. Miller" <Todd.Miller@courtesan.com>, Peter Pentchev <roam@ringlet.net>, 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>
In-Reply-To: <20011007203852.G37270@coffee.q9media.com>; from mike@FreeBSD.ORG on Sun, Oct 07, 2001 at 08:38:52PM -0400
References:  <20011004121640.C1959@ringworld.oblivion.bg> <20011004121933.B31795@coffee.q9media.com> <200110041650.f94GoL10010161@xerxes.courtesan.com> <20011007203852.G37270@coffee.q9media.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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-audit" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011008194642.A696>