Skip to content

Commit 677f66f

Browse files
committed
Fix MS-CAB writing
1 parent 8ff2058 commit 677f66f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

BinaryObjectScanner/FileType/MicrosoftCAB.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public bool Extract(Stream? stream, string file, string outDir, bool includeDebu
5858
// Uncompressed data
5959
if ((folder.CompressionType & CompressionType.TYPE_NONE) != 0)
6060
{
61-
ms.Write(db.CompressedData);
61+
ms.Write(db.CompressedData, 0, db.CompressedData.Length);
6262
ms.Flush();
6363
}
6464

@@ -75,7 +75,7 @@ public bool Extract(Stream? stream, string file, string outDir, bool includeDebu
7575
uint windowBits = (uint)(((ushort)folder.CompressionType >> 8) & 0x1f);
7676
var decomp = SabreTools.Compression.Quantum.Decompressor.Create(db.CompressedData, windowBits);
7777
byte[] data = decomp.Process();
78-
ms.Write(data);
78+
ms.Write(data, 0, data.Length);
7979
ms.Flush();
8080
}
8181

@@ -118,7 +118,7 @@ public bool Extract(Stream? stream, string file, string outDir, bool includeDebu
118118
Directory.CreateDirectory(directoryName);
119119

120120
using var of = File.OpenWrite(tempFile);
121-
of.Write(fileData);
121+
of.Write(fileData, 0, fileData.Length);
122122
of.Flush();
123123
}
124124
catch (Exception ex)

0 commit comments

Comments
 (0)