Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753603Ab0ARPK5 (ORCPT ); Mon, 18 Jan 2010 10:10:57 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752843Ab0ARPK4 (ORCPT ); Mon, 18 Jan 2010 10:10:56 -0500 Received: from mail-pw0-f42.google.com ([209.85.160.42]:37799 "EHLO mail-pw0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752759Ab0ARPKz convert rfc822-to-8bit (ORCPT ); Mon, 18 Jan 2010 10:10:55 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=WT+2LCUnXWFZ4pHwsnNEIqGWHABaD6rln3Dz0gcVwcQpBQ9lmYxTf82GiWQfIdqr+u 6iaVDIF1TG8p7pbVzrGE+MdRB4Uo2c/QwSIrlUV3czLVq0rSP1sUWuJOqyo80ym6vaiB kuXhO6Q7z2QJ9hqrgjoF1GA9XL/47ItHBpk3M= MIME-Version: 1.0 In-Reply-To: <4B53BDC5.1010201@cn.fujitsu.com> References: <30e5fd087ee6fbe992cde8f09d945ed160b0c117.1263675077.git.andre.goddard@gmail.com> <4B53BDC5.1010201@cn.fujitsu.com> From: =?ISO-8859-1?Q?Andr=E9_Goddard_Rosa?= Date: Mon, 18 Jan 2010 13:10:35 -0200 Message-ID: Subject: Re: [PATCH 2/2] string: teach strnstr() to not search past NUL-terminator To: Li Zefan Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, Alex Riesen , Andrew Morton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 712 Lines: 20 On Sun, Jan 17, 2010 at 11:47 PM, Li Zefan wrote: > Andr? Goddard Rosa wrote: >> As noticed by Alex Riesen at: >> http://marc.info/?l=linux-kernel&m=126364040821071&w=2 >> > Please don't make this change, it's the user's responsibility > to make sure @len won't exceed @s1's length. > > All the string functions of "n" version should work when > @s1 is not null-terminated, so don't call strlen() on @s1. Fair enough, agreed. Thank you, Andr? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/