Re: [PATCH 2/2] string: teach strnstr() to not search past NUL-terminator

From: André Goddard Rosa
Date: Mon Jan 18 2010 - 10:11:01 EST


On Sun, Jan 17, 2010 at 11:47 PM, Li Zefan <lizf@xxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/