mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix truncation to 0 bytes
svn path=/trunk/; revision=4040
This commit is contained in:
parent
10d48ac01e
commit
96fdaea58f
1 changed files with 20 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
/* $Id: finfo.c,v 1.24 2003/01/11 16:00:16 hbirr Exp $
|
||||
/* $Id: finfo.c,v 1.25 2003/01/19 01:06:09 gvg Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -472,7 +472,7 @@ VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (NewSize <= Fcb->RFCB.AllocationSize.u.LowPart - ClusterSize)
|
||||
else if (NewSize + ClusterSize <= Fcb->RFCB.AllocationSize.u.LowPart)
|
||||
{
|
||||
if (NewSize > 0)
|
||||
{
|
||||
|
@ -480,12 +480,16 @@ VfatSetAllocationSizeInformation(PFILE_OBJECT FileObject,
|
|||
ROUND_DOWN(NewSize - 1, ClusterSize),
|
||||
&Cluster, FALSE);
|
||||
|
||||
}
|
||||
NCluster = Cluster;
|
||||
Status = NextCluster (DeviceExt, Fcb, Cluster, &NCluster, FALSE);
|
||||
WriteCluster(DeviceExt, Cluster, 0xffffffff);
|
||||
Cluster = NCluster;
|
||||
while (Cluster != 0xffffffff)
|
||||
}
|
||||
else
|
||||
{
|
||||
Cluster = FirstCluster;
|
||||
}
|
||||
while (0xffffffff != Cluster && 0 != Cluster)
|
||||
{
|
||||
NextCluster (DeviceExt, Fcb, Cluster, &NCluster, FALSE);
|
||||
WriteCluster (DeviceExt, Cluster, 0);
|
||||
|
|
Loading…
Reference in a new issue