Re: generic strncpy - off-by-one error

From: Yoshinori Sato
Date: Tue Aug 12 2003 - 09:57:23 EST


I made a mistake. This is a good patch.

--- lib/string.c~ 2003-08-09 20:30:36.000000000 +0900
+++ lib/string.c 2003-08-12 23:27:08.000000000 +0900
@@ -89,7 +89,7 @@

while (count && (*dest++ = *src++) != '\0')
count--;
- while (count) {
+ while (count > 1) {
*dest++ = 0;
count--;
}

--
Yoshinori Sato
<ysato@xxxxxxxxxxxxxxxxxxxx>
-
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/