mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-24 12:35:31 +00:00
Fix incorrect size of array when setting metadata of long file names
This commit is contained in:
parent
b04f64810e
commit
85f95013b5
1 changed files with 5 additions and 4 deletions
|
|
@ -1295,10 +1295,10 @@ namespace Cosmos.System.FileSystem.FAT.Listing
|
||||||
|
|
||||||
if (xData.Length > 0)
|
if (xData.Length > 0)
|
||||||
{
|
{
|
||||||
var xValue = new byte[aEntryMetadata.DataLength];
|
var xValue = new byte[aEntryMetadata.DataLength * 4];
|
||||||
xValue.SetUInt32(0, aValue);
|
xValue.SetUInt32(0, aValue);
|
||||||
uint offset = aEntryHeaderDataOffset + aEntryMetadata.DataOffset;
|
uint offset = aEntryHeaderDataOffset + aEntryMetadata.DataOffset;
|
||||||
Array.Copy(xValue, 0, xData, (int)offset, (int)aEntryMetadata.DataLength);
|
Array.Copy(xValue, 0, xData, (int)offset, (int)aEntryMetadata.DataLength * 4);
|
||||||
SetDirectoryEntryData(xData);
|
SetDirectoryEntryData(xData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1340,11 +1340,12 @@ namespace Cosmos.System.FileSystem.FAT.Listing
|
||||||
|
|
||||||
if (xData.Length > 0)
|
if (xData.Length > 0)
|
||||||
{
|
{
|
||||||
var xValue = new byte[aEntryMetadata.DataLength];
|
Global.mFileSystemDebugger.SendInternal("length = " + aEntryMetadata.DataLength);
|
||||||
|
var xValue = new byte[aEntryMetadata.DataLength * 4];
|
||||||
xValue.SetUInt32(0, (uint)aValue);
|
xValue.SetUInt32(0, (uint)aValue);
|
||||||
uint offset = aEntryHeaderDataOffset + aEntryMetadata.DataOffset;
|
uint offset = aEntryHeaderDataOffset + aEntryMetadata.DataOffset;
|
||||||
Global.mFileSystemDebugger.SendInternal("offset = " + offset);
|
Global.mFileSystemDebugger.SendInternal("offset = " + offset);
|
||||||
Array.Copy(xValue, 0, xData, (int)offset, (int)aEntryMetadata.DataLength);
|
Array.Copy(xValue, 0, xData, (int)offset, (int)aEntryMetadata.DataLength * 4);
|
||||||
SetDirectoryEntryData(xData);
|
SetDirectoryEntryData(xData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue