diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-09-22 19:43:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:27 -0400 |
commit | ca976c53de0c33160083d36f70bd18d7970f6969 (patch) | |
tree | efd3abdc12b0c636a4dba94dbcab4bafc78423b8 /fs/smbfs/proc.c | |
parent | fa081b00a80ef3f4575c99af6e97d29e1628cf51 (diff) |
smbfs: read buffer overflow
This function uses signed integers for the unix_date and local variables -
if a negative number is supplied and the leap-year condition is not met,
month will be 0, leading to a read of day_n[-1]
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/smbfs/proc.c')
-rw-r--r-- | fs/smbfs/proc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smbfs/proc.c b/fs/smbfs/proc.c index 9468168b9af..71c29b6670b 100644 --- a/fs/smbfs/proc.c +++ b/fs/smbfs/proc.c | |||
@@ -509,7 +509,7 @@ date_unix2dos(struct smb_sb_info *server, | |||
509 | month = 2; | 509 | month = 2; |
510 | } else { | 510 | } else { |
511 | nl_day = (year & 3) || day <= 59 ? day : day - 1; | 511 | nl_day = (year & 3) || day <= 59 ? day : day - 1; |
512 | for (month = 0; month < 12; month++) | 512 | for (month = 1; month < 12; month++) |
513 | if (day_n[month] > nl_day) | 513 | if (day_n[month] > nl_day) |
514 | break; | 514 | break; |
515 | } | 515 | } |