Re: [PATCH] Repalce strncmp by memcmp

From: Andi Kleen
Date: Mon Nov 29 2010 - 05:18:12 EST


Pavel Vasilyev <pavel@xxxxxxxxxxx> writes:

> This patch replace all strncmp(a, b, c) by memcmp(a, b, c).

Those two calls are not equivalent. Think what happens when a or b
are shorter than n and one of them is at the end of a page
before a memory hole.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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/