lkml.org 
[lkml]   [2003]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectgeneric strncpy - off-by-one error
zero fill count is off-by-one error

--- lib/string.c~ 2003-08-09 20:30:36.000000000 +0900
+++ lib/string.c 2003-08-12 22:55:47.000000000 +0900
@@ -89,7 +89,8 @@

while (count && (*dest++ = *src++) != '\0')
count--;
- while (count) {
+ count--;
+ while (count > 0) {
*dest++ = 0;
count--;
}
--
Yoshinori Sato
<ysato@users.sourceforge.jp>
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.056 / U:1.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site