mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 01:38:57 +00:00
Submitted by: Wolfgang Solfrank <ws@tools.de>
Fix off-by-1-sector error in the range checking for the end of the root directory. It was possible for the root directory to overwrite the FAT.
This commit is contained in:
parent
7565491c79
commit
82f196916e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=7754
@ -1,4 +1,4 @@
|
||||
/* $Id: msdosfs_fat.c,v 1.4 1994/12/12 12:35:45 bde Exp $ */
|
||||
/* $Id: msdosfs_fat.c,v 1.5 1995/02/10 18:39:45 bde Exp $ */
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.12 1994/08/21 18:44:04 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -163,7 +163,7 @@ pcbmap(dep, findcn, bnp, cnp)
|
||||
*/
|
||||
if (cn == MSDOSFSROOT) {
|
||||
if (dep->de_Attributes & ATTR_DIRECTORY) {
|
||||
if (findcn * pmp->pm_SectPerClust > pmp->pm_rootdirsize) {
|
||||
if (findcn * pmp->pm_SectPerClust >= pmp->pm_rootdirsize) {
|
||||
if (cnp)
|
||||
*cnp = pmp->pm_rootdirsize / pmp->pm_SectPerClust;
|
||||
return E2BIG;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: msdosfs_fat.c,v 1.4 1994/12/12 12:35:45 bde Exp $ */
|
||||
/* $Id: msdosfs_fat.c,v 1.5 1995/02/10 18:39:45 bde Exp $ */
|
||||
/* $NetBSD: msdosfs_fat.c,v 1.12 1994/08/21 18:44:04 ws Exp $ */
|
||||
|
||||
/*-
|
||||
@ -163,7 +163,7 @@ pcbmap(dep, findcn, bnp, cnp)
|
||||
*/
|
||||
if (cn == MSDOSFSROOT) {
|
||||
if (dep->de_Attributes & ATTR_DIRECTORY) {
|
||||
if (findcn * pmp->pm_SectPerClust > pmp->pm_rootdirsize) {
|
||||
if (findcn * pmp->pm_SectPerClust >= pmp->pm_rootdirsize) {
|
||||
if (cnp)
|
||||
*cnp = pmp->pm_rootdirsize / pmp->pm_SectPerClust;
|
||||
return E2BIG;
|
||||
|
Loading…
Reference in New Issue
Block a user