mirror of
https://github.com/aaru-dps/Aaru.git
synced 2026-04-05 21:44:17 +00:00
[NTFS] Guard against too big non-resident data sizes.
This commit is contained in:
@@ -535,6 +535,13 @@ public sealed partial class NTFS
|
|||||||
/// <returns>Error number indicating success or failure.</returns>
|
/// <returns>Error number indicating success or failure.</returns>
|
||||||
ErrorNumber ReadNonResidentData(List<(long offset, long length)> dataRuns, long dataSize, ref byte[] buf)
|
ErrorNumber ReadNonResidentData(List<(long offset, long length)> dataRuns, long dataSize, ref byte[] buf)
|
||||||
{
|
{
|
||||||
|
if(dataSize > int.MaxValue)
|
||||||
|
{
|
||||||
|
AaruLogging.Debug(MODULE_NAME, "Non-resident data size {0} exceeds maximum array size", dataSize);
|
||||||
|
|
||||||
|
return ErrorNumber.OutOfRange;
|
||||||
|
}
|
||||||
|
|
||||||
buf = new byte[dataSize];
|
buf = new byte[dataSize];
|
||||||
|
|
||||||
long bytesRead = 0;
|
long bytesRead = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user